<template>
	<view class="wrap fs-mini"
		:style="colorStyle">
		<skeleton :show="showSkeleton"
			:isNodes="isNodes"
			ref="skeleton"
			loading="chiaroscuro"
			selector="skeleton"
			bgcolor="#FFF"></skeleton>

		<!--  start  非支付宝小程序导航栏  -->
		<!-- #ifndef MP-ALIPAY -->
		<view class="product-con skeleton"
			:style="{ visibility: showSkeleton ? 'hidden' : 'visible' }">
			<view>
				<!--微信：自定义导航栏-->
				<view class="w-full fixed-lt z-99 nav-bar"
					:style="[navBarStyle]">
					<view class="w-full px-20 h-80 flex-between-center">
						<!-- #ifdef MP -->
						<view class="fixed flex-center opac"
							:style="[menuButtonStyle]">
						<!-- #endif -->
							<!-- #ifndef MP -->
							<view class="menu_box flex-center opac">
							<!-- #endif -->
								<image src="@/static/img/back_icon.png"
									class="w-32 h-32"
									@tap="backTap"></image>
								<text class="menu_line"></text>
								<image src="@/static/img/menu_icon.png"
									class="w-32 h-32"
									@tap="moreNav"></image>
							</view>
							<!-- #ifdef MP -->
							<view class="fixed rd-50-p111- flex-center opac"
								:style="[shareButtonStyle]"
								@tap="listenerActionSheet"
								v-show="diyProduct.openShare">
							<!-- #endif -->
								<!-- #ifndef MP -->
								<view class="w-60 h-60 rd-50-p111- flex-center opac"
									@tap="listenerActionSheet"
									v-show="diyProduct.openShare">
								<!-- #endif -->
									<image src="@/static/img/share_icon.png"
										class="w-32 h-32"></image>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!-- #endif -->
				<!--  end  导航栏  -->

				<!--  start  支付宝小程序导航栏  -->
				<!-- #ifdef MP-ALIPAY -->
				<view class="product-con skeleton"
					:style="{ visibility: showSkeleton ? 'hidden' : 'visible' }">
					<view>
						<view class="w-full fixed-lt z-99 nav-bar"
							:style="[navBarStyle]">
							<view class="w-full px-20 h-80 flex-between-center">
								<!-- <view class="fixed flex-center opac"
									:style="[menuButtonStyleZfb]">
									<image src="@/static/img/menu_icon.png"
										class="w-32 h-32"
										@tap="moreNav"></image>
								</view> -->

								<!-- <button open-type="share"
									v-show="diyProduct.openShare"
									class="fixed rd-50-p111- flex-center opac"
									:style="[shareButtonStyleZfb]">
									<image src="@/static/img/share_icon.png"
										class="w-32 h-32 h-322222"></image>
								</button> -->
							</view>
						</view>
					</view>
				</view>
				<!-- #endif -->
				<!--  end  支付宝小程序导航栏  -->


				<homeList :navH="46 + sysHeight"
					:currentPage="currentPage"
					:sysHeight="sysHeight"
					:openNavList="diyProduct.navList"></homeList>
				<view>
					<!-- 商品轮播图 -->
					<productConSwiper :goodsType="attr.goodsType"
						:goodsId="id"
						:autoHeight="diyProduct.pictureConfig"
						:showDot="diyProduct.swiperDot"
						:imgUrls="productSwiper"
						:videoline="productVideoLink"
						@videoPause="videoPause"
						@goLeaseDesc="goLeaseDesc"
						class="skeleton-rect"></productConSwiper>
					<!--         关联商品:同款推荐-->
					<!--          <view v-if="from!='qo' && similarProductList.length>0 && attr.goodsType!='mall'" class="relate-goods" :style="{'paddingBottom': !activityBg ? '0' : '30rpx'}">-->
					<!--            <view class="item"-->
					<!--                 :class="{'item-active':initProduct.id==id}"-->
					<!--                 @click="selectSimilarProduct(initProduct.id)">-->
					<!--              <image :src="initProduct.image" class="l"></image>-->
					<!--            </view>-->
					<!--            <view class="line-text fs-regular">-->
					<!--              同款<br>推荐-->
					<!--            </view>-->
					<!--            <view class="item"-->
					<!--                  :class="{'item-active':item.id==id,'item-store':item.relation_id>0}"-->
					<!--                  @click="selectSimilarProduct(item.id)"-->
					<!--                  v-for="(item,index) in similarProductList" :key="index"-->
					<!--            >-->
					<!--              <image :src="item.image" class="l"></image>-->
					<!--              <view class="r">-->
					<!--                <view class="title line1">-->
					<!--                  {{item.level}}-->
					<!--                </view>-->
					<!--                <view class="price">￥{{item.day_price}}/天起</view>-->
					<!--              </view>-->
					<!--              <view v-if="item.relation_id>0" class="store-tip">门店</view>-->
					<!--            </view>-->
					<!--          </view>-->
					<!-- 1 带背景图价格：氛围图 -->
					<view class="atmosphere-card rd-t-40rpx relative w-full h-152 flex justify-between"
						:style="{ backgroundImage: cardBg }"
						v-if="activityBg"
						style="position: relative;">
						<view class="atmosphere-card-price flex justify-between w-full  text--w111-fff pl-40 pr-40">
							<baseMoney :leaseTagShow="false"
								:money="getPrice(storeInfo)"
								:leaseType="storeInfo.lease_type"
								symbolSize="32"
								integerSize="48"
								decimalSize="32"
								color="#ffffff"
								weight></baseMoney>
							<!-- 全部商品，右侧显示商城的价格 -->
							<!--              <text v-if="attr.goodsType==='All'" class=" text&#45;&#45;w111-fff pl-12">直接到手价￥{{ storeInfo.price }}</text>-->
							<!--							<view class=" text&#45;&#45;w111-fff pl-12"> 售价{{ attr.productSelect[attr.goodsTypeSelect].price }} </view>-->
							<!--              <view class=" text&#45;&#45;w111-fff pl-12" v-if="showVipPrice">会员价¥{{ storeInfo.vip_price }}</view>-->
						</view>
					</view>
					<!-- 商品介绍卡片 -->
					<view class="info_card relative">
						<view class="px-20">
							<view class="w-full rd-24rpx p-20 mt-20 b-ff">
								<!-- 骨架屏展示 -->
								<view v-if="showSkeleton">
									<view class="w-full h-46 skeleton-rect mt-20"></view>
									<view class="mt-24 flex">
										<view class="w-200 h-46 skeleton-rect"></view>
										<view class="w-100 h-46 skeleton-rect ml-24"></view>
									</view>
									<view class="mt-24 flex-between-center">
										<view class="w-200 h-46 skeleton-rect"></view>
										<view class="w-200 h-46 skeleton-rect"></view>
										<view class="w-200 h-46 skeleton-rect"></view>
									</view>
									<view class="mt-24 flex-between-center">
										<view class="w-96 h-46 skeleton-rect"></view>
										<view class="flex-1 h-46 skeleton-rect ml-22"></view>
									</view>
									<view class="mt-24 flex-between-center">
										<view class="w-96 h-46 skeleton-rect"></view>
										<view class="flex-1 h-46 skeleton-rect ml-22"></view>
									</view>
									<view class="mt-24 flex-between-center">
										<view class="w-96 h-46 skeleton-rect"></view>
										<view class="flex-1 h-46 skeleton-rect ml-22"></view>
									</view>
									<view class="mt-24 flex">
										<view class="w-400 h-200 skeleton-rect"></view>
										<view class="w-400 h-200 skeleton-rect ml-24"></view>
									</view>
								</view>
								<!-- todo sku小图 隐藏不用 -->
								<!--                <view class="flex mb-32" v-if="storeInfo.spec_type">-->
								<!--                  <view class="flex-1 flex-center">-->
								<!--                    <view :class="isSwiper ? 'active_pic' : 'scroll_pic'" @tap="selectSwiper">-->
								<!--                      <image :src="storeInfo.image"></image>-->
								<!--                    </view>-->
								<!--                    <view class="w-76 h-80 flex-col flex-center  text&#45;&#45;w111-333 lh-30rpx">-->
								<!--                      <text>{{ skuArr[attr.goodsTypeSelect].length }}款</text>-->
								<!--                      <text>可选</text>-->
								<!--                    </view>-->
								<!--                  </view>-->
								<!--                  <scroll-view scroll-x="true" scroll-with-animation-->
								<!--                               class="white-nowrap vertical-middle w-530" show-scrollbar="false">-->
								<!--                    <view class="flex w-full">-->
								<!--                      <view class="inline-block mr-16"-->
								<!--                            :class="item.suk == attrValue[attr.goodsTypeSelect] && !isSwiper ? 'active_pic' : 'scroll_pic'"-->
								<!--                            v-for="(item, index) in skuArr[attr.goodsTypeSelect]" :key="index"-->
								<!--                            @tap="changeAttrPic(item,index)">-->
								<!--                        <image :src="item.small_image"></image>-->
								<!--                      </view>-->
								<!--                    </view>-->
								<!--                  </scroll-view>-->
								<!--                </view>-->
								<!--                芝麻免押-->
								<!--                <view class="zhima-box flex-y-center p-16 mb-10 ">-->
								<!--                  <view class="l flex-y-center mr-12">-->
								<!--                    <view class="ebao-iconfont ebao-zhimaxinyong mr-10"></view>-->
								<!--                    <view>芝麻信用</view>-->
								<!--                    <view class="mr-10 ml-10">|</view>-->
								<!--                    <view>免押金</view>-->
								<!--                  </view>-->
								<!--                  <view class="text&#45;&#45;w111-333">芝麻分550及以上可享</view>-->
								<!--                </view>-->

								<!--                正常价格显示-->
								<view class="flex-y-center"
									v-if="!activityBg">
									<view class="flex items-baseline"
										style="flex:1;">
										<!-- 2 活动价格 -->
										<!--                    <view class="flex items-baseline justify-between w-full"-->
										<!--                          v-if="computedPrice.deduction.pay_price < computedPrice.deduction.sum_price">-->
										<!--                      <baseMoney-->
										<!--                          :leaseTagShow="false"-->
										<!--                          :money="getPrice(storeInfo)"-->
										<!--                          :leaseType="storeInfo.lease_type"-->
										<!--                          symbolSize="32"-->
										<!--                          integerSize="48"-->
										<!--                          preFixSize="22"-->
										<!--                          textColor="var(&#45;&#45;view-theme)"-->
										<!--                          decimalSize="32" weight></baseMoney>-->
										<!--                      &lt;!&ndash; 全部商品，右侧显示商城的价格 &ndash;&gt;-->
										<!--                      <text class=" text&#45;&#45;w111-999 pl-12">-->
										<!--                        已售{{storeInfo.fsales}}-->
										<!--&lt;!&ndash;                        直接到手价￥{{ storeInfo.price }}&ndash;&gt;-->
										<!--                      </text>-->
										<!--                      &lt;!&ndash;											<view class=" text&#45;&#45;w111-3d3d3d pl-12"> 售价{{ attr.productSelect[attr.goodsTypeSelect].price }} </view>&ndash;&gt;-->
										<!--                    </view>-->
										<!-- 正常价格-->
										<view class="common-price">
											<view class="flex align-item-baseline">
												<baseMoney :leaseTagShow="false"
													:money="getPrice(storeInfo)"
													:leaseType="storeInfo.lease_type"
													symbolSize="32"
													integerSize="48"
													preFixSize="22"
													textColor="var(--view-theme)"
													decimalSize="32"
													weight></baseMoney>
												<!-- vip价格 -->
												<view class="svip-badge h-36 ml-16 acea-row row-middle"
													v-if="showVipPrice">
													<view v-if="storeInfo.vip_price > 0"
														class="h-36 svip_rd fs-18 bg--w111-484643 text--w111-FDDAA4 px-8 acea-row row-middle">
														SVIP
													</view>
													<view v-if="['mall'].includes(attr.goodsType)"
														class="px-8 Regular fw-600 acea-row row-middle">
														¥{{ storeInfo.vip_price }}
													</view>
													<view v-if="['All', 'lease'].includes(attr.goodsType)"
														class="px-8 Regular fw-600 acea-row row-middle flex flex-nowrap">
														¥{{ storeInfo.vip_day_price }}/<text class="">天</text></view>
												</view>
												<!--                        商城里程币-->
												<view v-if="storeInfo.give_integral > 0 && attr.goodsType === 'mall'"
													class=" text--w111-999 pl-12">
													里程币{{ storeInfo.give_integral }}
												</view>
											</view>
											<!-- 全部商品，右侧显示商城的价格 -->

											<view style="display: flex;align-items: center;">
												<text class=" text--w111-999 pl-12">
													已售{{ storeInfo.fsales }}
													<!--                        直接到手价￥{{ storeInfo.price }}-->
												</text>
												<button open-type="share"
													v-show="diyProduct.openShare"
													class="rd-50-p111- flex-center opac"
													style="height: 40rpx;margin-left: 16rpx;border: none;box-shadow: none;">
													<image src="@/static/img/share_icon.png"
														class="w-32 h-32"></image>
												</button>
											</view>
										</view>
									</view>
								</view>

								<!-- 优惠券 -->
								<view class="flex-between-center mt-16 fs-20"
									style="line-height: 1.3"
									v-if="computedPrice.deduction.pay_price < computedPrice.deduction.sum_price &&
										(discountInfo.discount.length > 0 || coupon.list > 0 || computedPrice.deduction.vip_price > 0)
									">
									<scroll-view scroll-x="true"
										show-scrollbar="false"
										class="white-nowrap vertical-middle flex-1">
										<view class="inline-block  rd-8rpx text-center  text-primary-con px-8  bg-primary-light mr-16"
											v-for="(item, index) in discountInfo.discount"
											:key="index + 'i'">{{ item.title }}
										</view>
										<view class="inline-block  rd-8rpx text-center text-primary-con px-8 bg-primary-light mr-16"
											v-for="(item, index) in coupon.list"
											:key="index + 'k'">
											<!--                      满{{ item.use_min_price }}元可用-->
											{{ item.coupon_title }}
										</view>
										<view class="inline-block rd-8rpx text-center   text-primary-con px-8 bg-primary-light mr-16"
											v-if="computedPrice.deduction.vip_price > 0">会员优惠
										</view>
									</scroll-view>
									<view class=" text-primary-con"
										@tap="openPerferentDrawer">查看
										<text class="iconfont icon-ic_rightarrow fs-18"></text>
									</view>
								</view>



								<!-- 芝麻免押-->
								<view v-if="attr.goodsType != 'mall'"
									class="fs-20 zhima-box-new flex align-item-center flex-wrap mt-20 w-full  lh-1">
									<view class="ebao-iconfont ebao-zhimaxinyong mr-10 fs-20"
										style="color:#1677ff;"></view>
									<view class="flex align-item-center">芝麻信用·免押金 <view class="line"></view> 芝麻分550及以上可享

										<view class="flex"
											v-if="storeInfo.is_buyout == 1 || storeInfo.is_relet == 1">
											<view class="line"></view>
											支持
											<text v-if="storeInfo.is_buyout == 1">随时买断</text>
											<text v-if="storeInfo.is_relet == 1">
												<text v-if="storeInfo.is_buyout == 1">、</text>
												到期续租
											</text>
											！
										</view>
									</view>
								</view>


								<!-- 商品名称 -->
								<view class="mt-20 fs-28 text--w111-333 fw-500 mb-20"
									style="line-height: 1.5">
									<!--                  <secondHandTag :new_old="storeInfo.new_old" :level="storeInfo.level"></secondHandTag>-->
									{{ storeInfo.store_name }}
								</view>

								<!-- 标签类集合 -->
								<view class="flex align-item-center w-full"
									style="overflow-x: auto">
									<!-- 商品标签 -->
									<BaseTag :text="label.label_name"
										:color="label.color"
										:background="label.bg_color"
										:borderColor="label.border_color"
										:circle="label.border_color ? true : false"
										:imgSrc="label.icon"
										size="middle"
										v-for="(label, idx) in storeInfo.store_label"
										:key="idx"></BaseTag>
									<!-- 排行榜标签-->
									<view class="top-box fs-18 white-nowrap"
										v-if="storeInfo.rank > 0 && diyProduct.showRank">
										<view class="top-item mb-8 mr-12"
											@tap="goPage(1, '/pages/columnGoods/rank/index?type=' + storeInfo.rank_type)">
											{{ storeInfo.rank_type | rankType }} · 第{{ storeInfo.rank }}名
											<text class="iconfont fs-18 icon-ic_rightarrow "></text>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="px-20 overflow">
							<!-- SVIP card -->
							<view class="mb-20 rd-16rpx bg--w111-FFF0D1 flex-between-center"
								style="padding:10rpx 20rpx;"
								v-if="showVip">
								<view class="flex-y-center">
									<image src="@/static/img/vip_leval.png"
										class="w-36 h-36"></image>
									<view class="pl-8">
										<text class=" text--w111-7E4B06">开通 SVIP会员 预计省</text>
										<text class="text-primary-con  px-4">{{ diff }}</text>
										<text class=" text--w111-7E4B06">元</text>
									</view>
								</view>
								<view class="flex-y-center text--w111-7E4B06"
									@tap="goPage(1, '/pages/annex/vip_paid/index')">
									<text>立即开通</text>
									<text class="iconfont icon-ic_rightarrow fs-18"></text>
								</view>
							</view>
							<!--              0元租包-->
							<view class="zero-box"
								v-if="is_super_product && !is_super_user">
								<image @click="goZero"
									class="w-full"
									mode="widthFix"
									src="https://qn.ebaozu.cn/public/mini/zeroVip/%E5%95%86%E5%93%81%E8%AF%A6%E6%83%85-0%E5%85%83%E7%A7%9F%E5%8C%85.png">
								</image>
							</view>
							<!-- 排行榜 card -->
							<!--              <view class="h-80 rd-16rpx b-ff flex-between-center mt-24 px-20"-->
							<!--                    @tap="goPage(1,'/pages/columnGoods/rank/index?type=' + storeInfo.rank_type)"-->
							<!--                    v-if="storeInfo.rank > 0 && diyProduct.showRank">-->
							<!--                <view class="flex-between-center flex-1">-->
							<!--                  <view class="flex-y-center">-->
							<!--                    <image :src="imgHost + '/statics/images/product/cup_icon.png'" class="w-32 h-32"></image>-->
							<!--                    <image :src="imgHost + '/statics/images/product/rank_icon.png'" class="w-76 h-24 mx-8"></image>-->
							<!--                  </view>-->
							<!--                  <text class=" text&#45;&#45;w111-333">{{ storeInfo.rank_type | rankType }}·第{{ storeInfo.rank }}名-->
							<!--                  </text>-->
							<!--                </view>-->
							<!--                <text class="iconfont icon-ic_rightarrow  text&#45;&#45;w111-666"></text>-->
							<!--              </view>-->
						</view>
					</view>


					<view class="px-20">

						<view class="newold-box mt-16 b-fa rd-8rpx rd-8rpx"
							v-if="attr.goodsType != 'mall' || specsInfo.specs.length">
							<view class="item-one"
								v-if="attr.goodsType != 'mall'">
								<view class="l">
									<view class="l-1"
										@click="oldDescModalShow = true">
										<text>
											<secondHandTag page="goodsDetail"
												:lease_type="storeInfo.lease_type"
												:new_old="storeInfo.new_old"
												:level="storeInfo.level"></secondHandTag>
										</text>
										<text class="ebao-iconfont fs-22 ebao-wenhao-xianxingyuankuang ml-4 text--w111-999 "></text>
									</view>
									<!--                  <view class="line"></view>-->
									<!--                  <view class="l-2 text-green ">已鉴定符合品牌工艺</view>-->
								</view>
								<!--                <view class="r">查看完整鉴定报告 <text class="iconfont icon-ic_rightarrow"></text></view>-->
							</view>
							<view class="line"
								v-if="specsInfo.specs.length"></view>
							<view class="item-two"
								v-if="specsInfo.specs.length"
								@click="specModalShow = true">
								<view class="l white-nowrap">参数</view>
								<view class="c">
									<view class="c-item"
										v-for="(item, index) in specsInfo.specs"
										:key="index">
										<view class="tit line1">{{ item.name }}</view>
										<view class="value line1">{{ item.value }}</view>
									</view>
								</view>
								<view class="r"><text class="iconfont icon-ic_rightarrow"></text></view>
							</view>
						</view>

						<!-- 活动 SKU选择 服务保障 -->
						<view class="rd-24rpx bg--w111-fff mt-16">
							<view class="flex-y-center h-100 rd-t-24rpx pl-20"
								v-if="activity.length && diyProduct.showService.includes(0)">
								<text class=" text--w111-888">活动</text>
								<view class="flex-y-center ml-32">
									<block v-for="(item, index) in activity"
										:key="index">
										<view class="inline-block px-16 h-48 lh-48rpx rd-24px bg-primary-light text-primary-con mr-16"
											v-if="item.type === '3'"
											@tap="goActivity(item)">
											<text class="iconfont icon-ic_user "></text>
											<text class=" pl-4">二人拼团</text>
											<text class="iconfont icon-ic_rightarrow "></text>
										</view>
										<view class="inline-block px-16 h-48 lh-48rpx rd-24px bg-primary-light text-primary-con mr-16"
											v-if="item.type === '1'"
											@tap="goActivity(item)">
											<text class="iconfont icon-ic_clock "></text>
											<text class=" pl-4">限时秒杀</text>
											<text class="iconfont icon-ic_rightarrow "></text>
										</view>
										<view class="inline-block px-16 h-48 lh-48rpx rd-24px bg-primary-light text-primary-con mr-16"
											v-if="item.type === '2'"
											@tap="goActivity(item)">
											<text class="iconfont icon-ic_sale "></text>
											<text class=" pl-4">参与砍价</text>
											<text class="iconfont icon-ic_rightarrow "></text>
										</view>
									</block>
								</view>
							</view>
							<!--              <view class="flex-between-center h-100 px-20" @tap="selecAttr"-->
							<!--                    v-if="attr.productAttr[attr.goodsTypeSelect].length && diyProduct.showService.includes(1)">-->
							<!--                <view class="flex-y-center">-->
							<!--                  <text class=" text&#45;&#45;w111-888 white-nowrap">选择</text>-->
							<!--                  <view class="ml-32 text&#45;&#45;w111-333  w-560 line1">{{ getAttrValueAlias() }}</view>-->
							<!--                </view>-->
							<!--                <text class="iconfont icon-ic_rightarrow  text&#45;&#45;w111-666"></text>-->
							<!--              </view>-->
							<!--              <view class="flex-between-center h-100 px-20" v-if="storeInfo.new_old==2" @click="oldDescModalShow=true">-->
							<!--                <view class="flex-y-center">-->
							<!--                  <text class=" text&#45;&#45;w111-888 white-nowrap">成色</text>-->
							<!--                  <view class="ml-32 text&#45;&#45;w111-333  w-524 line1">查看商品成色说明</view>-->
							<!--                </view>-->
							<!--                <text class="iconfont icon-ic_rightarrow  text&#45;&#45;w111-666"></text>-->
							<!--              </view>-->
							<view class="flex-between-center p-20 b-fa rd-8rpx"
								v-if="storeInfo.ensure && storeInfo.ensure.length && diyProduct.showService.includes(2)"
								@tap="() => { showServiceDrawer = true }">
								<text class="lh-1 flex-auto mr-20">服务</text>
								<view style="flex:1;justify-content: flex-start;"
									class="flex-y-center justify-between overflow-x-auto">
									<view style="flex:0 0 auto;"
										class="mr-38 flex align-item-center lh-1"
										v-for="(ensure, index) in ensureInfo.ensure"
										:key="index">
										<text class="ebao-iconfont ebao-duigou1 fs-mini"></text> {{ ensure.name }}
									</view>
									<!--                  <view class="ml-32 text&#45;&#45;w111-333  w-524 line1">{{ ensureInfo.ensureTitle }}</view>-->
								</view>
								<text class="iconfont icon-ic_rightarrow  text--w111-666 ml-10"></text>
							</view>
							<!--              <view class="flex-between-center h-100 px-20"-->
							<!--                    v-if="storeInfo.specs && storeInfo.specs.length && diyProduct.showService.includes(3)"-->
							<!--                    @tap="seeSpecs">-->
							<!--                <view class="flex-y-center">-->
							<!--                  <text class=" text&#45;&#45;w111-888">参数</text>-->
							<!--                  <view class="ml-32 text&#45;&#45;w111-333  w-524 line1">{{ specsInfo.specsTitle }}</view>-->
							<!--                </view>-->
							<!--                <text class="iconfont icon-ic_rightarrow  text&#45;&#45;w111-666"></text>-->
							<!--              </view>-->
							<!--              <view class="acea-row row-between h-146 pl-20 pr-20 pt-30"-->
							<!--                    v-if="isMention && Object.keys(storeList).length && diyProduct.showService.includes(4)"-->
							<!--                    @tap="showStoreList">-->
							<!--                <view class="acea-row">-->
							<!--                  <text class=" text&#45;&#45;w111-888">门店</text>-->
							<!--                  <view class="ml-32 text&#45;&#45;w111-333  w-524 line1">-->
							<!--                    <view class="">-->
							<!--                      <text class="iconfont icon-ic_mall  mr-12"></text>-->
							<!--                      {{ storeList.name }}-->
							<!--                    </view>-->
							<!--                    <view class=" text&#45;&#45;w111-666 mt-18 line1">{{-->
							<!--                        storeList.address-->
							<!--                      }}{{ ", " + storeList.detailed_address }}-->
							<!--                    </view>-->
							<!--                  </view>-->
							<!--                </view>-->
							<!--                <text class="iconfont icon-ic_rightarrow  text&#45;&#45;w111-666"></text>-->
							<!--              </view>-->
						</view>

						<!--            参数-->
						<!--            <view class="params-box rd-24rpx bg&#45;&#45;w111-fff mt-20" v-if="specsInfo.specs.length">-->
						<!--              <view class="item flex  text-center" v-for="(item,index) in specsInfo.specs">-->
						<!--                <view class="l p-14">{{item.name}}</view>-->
						<!--                <view class="r p-14">{{item.value}}</view>-->
						<!--              </view>-->
						<!--            </view>-->
						<!-- 评价卡片 -->
						<view class="rd-24rpx bg--w111-fff py-16"
							v-if="replyCount && diyProduct.showReply"
							@tap="goPage(1, '/pages/goods/goods_comment_list/index?product_id=' + id)">
							<view class="px-20 flex-between-center">
								<view>
									<text class="text--w111-333  fw-500">评价</text>
									<text class=" text--w111-666 pl-8">({{ replyCount }})</text>
								</view>
								<view class="flex-y-center">
									<text class=" text-primary-con">{{ replyChance }}%</text>
									<text class=" text--w111-999 pr-12">好评率</text>
									<text class="iconfont icon-ic_rightarrow  text--w111-666"></text>
								</view>
							</view>
							<!-- 滑动内容 -->
							<block v-if="replyCount">
								<userEvaluation :reply="reply"
									@changeLogin="changeLogin"
									:fromTo="1"></userEvaluation>
							</block>
						</view>
						<!-- 搭配购 -->
						<view class="rd-24rpx bg--w111-fff mt-20 py-30"
							v-if="discountsData.length && diyProduct.showMatch"
							@tap="goPage(1, '/pages/goods/match_pay/index?id=' + id)">
							<view class="px-20 flex-between-center">
								<view>
									<text class="text--w111-333  fw-500">搭配购</text>
									<text class=" text--w111-666 pl-8">({{ discountsData.length }})</text>
								</view>
								<text class="iconfont icon-ic_rightarrow  text--w111-666"></text>
							</view>
							<scroll-view scroll-x="true"
								class="white-nowrap vertical-middle w-690 mt-24 pl-20"
								show-scrollbar="false">
								<view class="inline-block mr-20"
									v-for="item in discountsData"
									:key="item.id">
									<view class="flex">
										<image class="w-164 h-164 rd-16rpx"
											:src="item.image"
											mode="aspectFill"></image>
										<view class="flex-1 pl-24">
											<view class="w-278 text--w111-333  break_word line1">{{ item.title }}</view>
											<view class="w-278 mt-20 text-center lh-30rpx break_word  text--w111-999 line2">
												<text v-for="(items, index) in item.products"
													:key="index">{{ items.store_name }} +</text>
											</view>
											<view class="flex-y-center  mt-20"
												v-if="item.max_discounts_price > 0">
												<text class="iconfont icon-a-ic_Money111 font-num "></text>
												<text class="text--w111-999 px-4">最多可省</text>
												<text class="font-color  fw-600">¥{{ item.max_discounts_price }}</text>
											</view>
										</view>
									</view>
								</view>
							</scroll-view>
						</view>
						<!-- 优品推荐 -->
						<view class="rd-24rpx bg--w111-fff  py-16"
							v-if="good_list.length && diyProduct.showRecommend">
							<view class="pl-20  fw-500 text--w111-333">优品推荐</view>
							<view class="grid-column-3 grid-gap-x-38rpx grid-gap-y-26rpx px-20 mt-28"
								v-if="good_list.length <= 6">
								<view v-for="(item, index) in good_list"
									:key="index"
									@tap="goPage(1, '/pages/goods_details/index?id=' + item.id)">
									<image class="w-198 h-198 rd-20rpx"
										:src="item.image"
										mode="aspectFill"></image>
									<view class="w-full line1  lh-26rpx pt-16">{{ item.store_name }}</view>
									<!--                  <view class="text-primary-con pt-14  lh-28rpx fw-600">¥{{ item.day_price }}</view>-->
								</view>
							</view>
							<scroll-view scroll-x="true"
								class="w-690 mt-24 pl-20"
								show-scrollbar="false"
								v-else>
								<view class="white-nowrap vertical-middle">
									<view class="inline-block recommend_pro"
										v-for="(item, index) in good_list"
										:key="index"
										v-if="(index % 2) == 0"
										@tap="goPage(1, '/pages/goods_details/index?id=' + item.id)">
										<image class="w-198 h-198 rd-20rpx"
											:src="item.image">
										</image>
										<view class="w-198 line1  lh-26rpx pt-16 text--w111-333">{{ item.store_name }}
										</view>
										<!--                    <view class="text-primary-con pt-14  lh-28rpx fw-600">¥{{ item.day_price }}</view>-->
									</view>
								</view>
								<view class="white-nowrap vertical-middle mt-24">
									<view class="inline-block recommend_pro"
										v-for="(item, index) in good_list"
										:key="index"
										v-if="(index % 2) != 0"
										@tap="goPage(1, '/pages/goods_details/index?id=' + item.id)">
										<image class="w-198 h-198 rd-20rpx"
											:src="item.image">
										</image>
										<view class="w-198 line1  lh-26rpx pt-16 text--w111-333">{{ item.store_name }}
										</view>
										<!--                    <view class="text-primary-con pt-14  lh-28rpx fw-600">¥{{ item.day_price }}</view>-->
									</view>
								</view>
							</scroll-view>
						</view>
						<!-- 底部操作按钮 -->
						<view class="page_footer bg--w111-fff-s111-80 w-full z-99 fixed-lb pb-safe">
							<view class="w-full pt-16 pb-16 pl-16 pr-20 flex">
								<view class="flex flex-y-center pl-20">
									<!--                  <view class="flex-col flex-center justify-between h-72 mr-20 " @tap="goPage(2,'/pages/index/index')"-->
									<!--                        v-if="diyProduct.menuList.includes(3)">-->
									<!--                    <text class="iconfont icon-ic_mall fs-36 fw-bold"></text>-->
									<!--                    <text class="fs-18">首页</text>-->
									<!--                  </view>-->
									<!--                  <view class="flex-col flex-center justify-between h-72 mr-20" @tap="listenerActionSheet"-->
									<!--                        v-if="diyProduct.menuList.includes(4)">-->
									<!--                    <text class="iconfont icon-ic_transmit1 fs-36 fw-bold"></text>-->
									<!--                    <text class="fs-18">分享</text>-->
									<!--                  </view>-->

									<!-- 支付宝客服 -->
									<!--                  <view class="flex-col flex-center justify-between h-80 pr-28 bg-transparent" style="border: none;"-->
									<!--                          hover-class='none' open-type='contact'-->
									<!--                          v-if="aliChat&&aliChat.chat_id">-->
									<!--                    <view class="h-30" style="margin-top: -4rpx">-->
									<!--                      <alipayChat :from_size="28"></alipayChat>-->
									<!--                    </view>-->
									<!--                    <text class="fs-18">客服</text>-->
									<!--                  </view>-->
									<!--  内部客服 && routineContact -->
									<button class="flex-col flex-center justify-between h-80 pr-28 bg-transparent"
										style="border: none;"
										hover-class='none'
										v-if="diyProduct.menuList.includes(0)"
										@tap="goGoodCall">
										<view>
											<text class="iconfont icon-ic_customerservice fs-48 fw-bold"></text>
										</view>
										<text class="fs-18">客服</text>
									</button>
									<!--  收藏  -->
									<view class="flex-col flex-center justify-between h-80 pr-28"
										@tap="setCollect"
										v-if="diyProduct.menuList.includes(1)">
										<text class="iconfont fs-48 fw-bold"
											:class="storeInfo.userCollect ? 'icon-ic_star1' : 'icon-ic_star'"
											style="margin-top: -4rpx"></text>
										<text class="fs-18">收藏</text>
									</view>
									<!-- <button open-type="share"
										class="flex-col flex-center justify-between h-80 pr-28 bg-transparent"
										style="border: none;"
										hover-class='none'
										v-show="diyProduct.openShare">
										<view>
											<text class="iconfont icon-ic_transmit1 fs-48 fw-bold"></text>
										</view>
										<text class="fs-18">分享</text>
									</button> -->
									<!--  购物车  -->
									<!-- 10.27以前的判断：v-if="diyProduct.menuList.includes(2)" -->
									<view class="flex-col  flex-center justify-between h-80 pr-28 animated relative"
										:class="animated == true ? 'bounceIn' : ''"
										@tap="goPage(2, '/pages/order_addcart/order_addcart')"
										v-if="attr.goodsType === 'mall'">
										<text class="iconfont icon-ic_ShoppingCart fs-48 fw-bold"></text>
										<text class="num-badge bg-color"
											v-if="parseFloat(CartCount) > 0">{{ CartCount || 0 }}</text>
										<text class="fs-18">购物车</text>
									</view>
								</view>



								<!-- 底部按钮 -->
								<view class="flex-1 bottom-box h-100 self-center grid-gap-16rpx">
									<!--  底部只有一个按钮的时候显示购物车按钮，-->
									<view v-if="attr.goodsType === 'mall'"
										class="w-full h-full flex-center join_cart rd-36px text--w111-fff "
										@tap="joinCart">加入购物车
									</view>
									<view v-if="attr.goodsType === 'All' || attr.goodsType === 'mall'"
										class="w-full h-full flex-center bg-color rd-36px text--w111-fff "
										@tap="goBuy">
										{{ is_store_buy || delivery_type == 2 || delivery_type == 3 ? '门店购买' : '立即购买' }}
									</view>
									<!--				  <view v-if="attr.goodsType==='lease' && is_super_product === 1"-->
									<!--				        class="w-full h-full flex-center join_cart rd-36px text&#45;&#45;w111-fff " @tap="goLeaseZero">-->
									<!--				    0元租赁-->
									<!--				  </view>-->
									<view v-if="attr.goodsType === 'All' || attr.goodsType === 'lease'"
										class="w-full h-full flex-center join_cart rd-36px text--w111-fff "
										@tap="goLease">
										<text v-if="is_super_user">0元随心租</text>
										<text v-else>免押租赁</text>
									</view>
								</view>


							</view>
						</view>
						<view class="rd-24rpx bg--w111-fff mt-20">
							<view class="rd-24rpx">
								<view id="past3"
									:style="{ position: 'sticky', top: (topBarHeight - 6) + 'px', zIndex: 1 }"
									class="fs-30 h-100 b-ff w-full px-32 flex-between-center ">
									<text :class="tabsIndex == 0 && 'activess'"
										@click="tabsIndex = 0">商品详情</text>
									<text :class="tabsIndex == 1 && 'activess'"
										@click="tabsIndex = 1"
										v-if="attr.goodsType != 'mall'">
										租赁流程
									</text>
									<text :class="tabsIndex == 2 && 'activess'"
										@click="tabsIndex = 2"
										v-if="attr.goodsType != 'mall'">常见问题</text>
								</view>
								<view class="conter">
									<view :style="{ display: tabsIndex == 0 ? 'block' : 'none' }">
										<!--                  实拍图-->
										<view class="live-picture"
											v-if="livePicture && livePicture.length > 0">
											<view class="live-tit">
												<view class="l">外观&细节图</view>
												<view class="r">点击图片可放大查看</view>
											</view>
											<view class="live-con">
												<view class="live-item"
													v-for="(liveItem, liveIndex) in livePicture"
													:key="liveIndex">
													<image @tap="previewImage(liveIndex)"
														:src="liveItem"
														mode="scaleToFill"></image>
												</view>
											</view>
											<view class="live-tip card-bg">
												特别说明：商品细节图按照平台标准拍摄，未拍摄所有细节受拍摄灯光、背景、显示器等因素影响，可能存在色差，一切以实物为准。
											</view>
										</view>
										<mp-html :preview-img="false"
											:selectable="false"
											:content="description" />
									</view>
									<view :style="{ display: tabsIndex == 1 ? 'block' : 'none' }">
										<mp-html :preview-img="false"
											:selectable="false"
											:content="leaseDesc" />
									</view>
									<view :style="{ display: tabsIndex == 2 ? 'block' : 'none' }">
										<!--                    <mp-html :preview-img="false" :selectable="false" :content="agreement[3]" />-->
										<publicFAQ></publicFAQ>
									</view>
									<!--                <view :style="{ display: tabsIndex == 1 ? 'block' : 'none' }">-->
									<!--                  <mp-html :preview-img="false" :selectable="false" :content="agreement[0]" />-->
									<!--                </view>-->
									<!--                <view :style="{ display: tabsIndex == 2 ? 'block' : 'none' }">-->
									<!--                  <mp-html :preview-img="false" :selectable="false" :content="agreement[1]" />-->
									<!--                </view>-->
									<!--                <view :style="{ display: tabsIndex == 3 ? 'block' : 'none' }">-->
									<!--                  <mp-html :preview-img="false" :selectable="false" :content="agreement[2]" />-->
									<!--                </view>-->

									<!--                <rich-text :selectable="false" :style="{ display: tabsIndex == 0 ? 'block' : 'none' }"-->
									<!--                           :nodes="description"/>-->
									<!--                <rich-text :selectable="false" :style="{ display: tabsIndex == 1 ? 'block' : 'none' }"-->
									<!--                           :nodes="agreement[0]"/>-->
									<!--                <rich-text :selectable="false" :style="{ display: tabsIndex == 2 ? 'block' : 'none' }"-->
									<!--                           :nodes="agreement[1]"/>-->
									<!--                <rich-text :selectable="false" :style="{ display: tabsIndex == 3 ? 'block' : 'none' }"-->
									<!--                           :nodes="agreement[2]"/>-->
									<!--                <rich-text :selectable="false" :style="{ display: tabsIndex == 4 ? 'block' : 'none' }"-->
									<!--                           :nodes="agreement[3]"/>-->
								</view>
							</view>
							<view class="pb-safe h-148"></view>
							<chatModal ref="chatModal"></chatModal>
							<!-- 服务抽屉 -->
							<service-modal :visible="showServiceDrawer"
								:ensureInfo="ensureInfo"
								@closeDrawer="() => { showServiceDrawer = false }"></service-modal>
							<!-- 成色说明 -->
							<old-desc-modal :visible="oldDescModalShow"
								@closeDrawer="() => { oldDescModalShow = false }"></old-desc-modal>
							<!-- 参数 -->
							<spec-modal :specs="specsInfo.specs"
								:visible="specModalShow"
								@closeDrawer="() => { specModalShow = false }"></spec-modal>
							<!-- 优惠弹窗 -->
							<preferential-modal :visible="showPerferentDrawer"
								:discountInfo="discountInfo"
								:coupon="coupon"
								:computedPrice="computedPrice"
								@ChangCouponsUseState="ChangCouponsUseState"
								@closeDrawer="() => { showPerferentDrawer = false }"
								@ruleToggle="ruleToggle"></preferential-modal>
							<!-- 商品：sku弹窗 -->
							<productWindow v-if="storeInfo.id"
								ref='productWindow'
								:attr="attr"
								:attrValue="attrValue"
								:isShow="1"
								:iSplus="1"
								:type="0"
								isExtends
								:storeInfo="storeInfo"
								:productId="storeInfo.id"
								:isStoreBuy="is_store_buy"
								:is_vip="is_vip"
								:storeId='storeId'
								:promotions_type="promotions_type"
								:productValue="productValue"
								:showVipPrice="showVipPrice"
								:is_super_user="is_super_user"
								@myevent="onMyEvent"
								@ChangeAttr="ChangeAttr"
								@ChangeCartNum="ChangeCartNum"
								@attrVal="attrVal"
								@iptCartNum="iptCartNum"
								@getImg="showImg"
								@deliveryFun="deliveryFun"
								@onAddressId="onAddressId"
								@onstoreId="onstoreId"
								@onConfirm="onConfirm"
								id="product-window"
								@getGoodsDetails="getGoodsDetails"></productWindow>
							<specs :specsInfo="specsInfo"
								@myevent="mySpecs"></specs>
							<cusPreviewImg ref="cusPreviewImg"
								:list="skuArr[attr.goodsTypeSelect]"
								@changeSwitch="changeSwitch"></cusPreviewImg>
							<!-- #ifdef H5 || APP-PLUS -->
							<zb-code ref="qrcode"
								:show="codeShow"
								:cid="cid"
								:val="codeVal"
								:size="size"
								:unit="unit"
								:background="background"
								:foreground="foreground"
								:pdground="pdground"
								:icon="codeIcon"
								:iconSize="iconsize"
								:onval="onval"
								:loadMake="loadMake"
								@result="qrR" />
							<!-- #endif -->
							<!-- 分享按钮 -->
							<view class="generate-posters pb-safe"
								:class="posters ? 'on' : ''">
								<view class="generateCon acea-row row-middle">
									<!-- #ifdef H5 -->
									<button class="item"
										hover-class="none"
										v-if="weixinStatus === true"
										@tap="H5ShareBox = true">
										<view class="pictrue">
											<image src="../../static/images/weixin.png"></image>
										</view>
										<view class="">分享给好友</view>
									</button>
									<!-- #endif -->
									<!-- #ifdef MP -->
									<button class="item"
										open-type="share"
										hover-class="none"
										style="border: none;">
										<view class="pictrue">
											<!-- #ifndef MP-ALIPAY -->
											<image src="../../static/images/weixin.png"></image>
											<!-- #endif -->
											<!-- #ifdef MP-ALIPAY -->
											<i class="ebao-iconfont ebao-zhifubao"
												style="font-size: 82rpx;color:#1677ff; "></i>
											<!-- #endif -->
										</view>
										<view class="">分享给好友</view>
									</button>
									<!-- #endif -->
									<!-- #ifdef APP-PLUS -->
									<view class="item"
										@tap="appShare('WXSceneSession')">
										<view class="pictrue">
											<image src="../../static/images/weixin.png"></image>
										</view>
										<view class="">分享给好友</view>
									</view>
									<view class="item"
										@tap="appShare('WXSenceTimeline')">
										<view class="pictrue">
											<image src="./static/weixinCircle.png"></image>
										</view>
										<view class="">分享朋友圈</view>
									</view>
									<!-- #endif -->
									<view class="item"
										@tap="getpreviewImage">
										<view class="pictrue">
											<image src="../../static/images/changan.png"></image>
										</view>
										<view class="">预览发图</view>
									</view>
									<!-- #ifndef H5  -->
									<button class="item"
										hover-class="none"
										@tap="savePosterPath"
										style="border: none;">
										<view class="pictrue">
											<image src="../../static/images/haibao.png"></image>
										</view>
										<view class="">保存海报</view>
									</button>
									<!-- #endif -->
								</view>
								<view class="generateClose flex-center"
									@tap="posterImageClose">取消</view>
							</view>
							<!-- 海报加载中 -->
							<div class="fixed-center"
								v-if="posters && !posterImageStatus">
								<image class="poster-loading"
									:src="imgHost + '/statics/images/poster_loading.png'"
									mode="widthFix"></image>
							</div>
							<!-- 海报展示 -->
							<view class="poster-mask"
								v-if="posterImageStatus || posters"></view>
							<view class="poster-pop"
								v-if="posterImageStatus">
								<image :src="posterImage"></image>
							</view>
							<canvas class="canvas"
								id="myCanvas"
								canvas-id="myCanvas"
								v-if="canvasStatus"></canvas>
							<!-- 发送给朋友图片 -->
							<view class="share-box"
								v-if="H5ShareBox">
								<image :src="imgHost + '/statics/images/share-info.png'"
									@tap="H5ShareBox = false">
								</image>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	import moment from "moment"
	import { attrValueAlias, bookZfbMsg, getPrice } from "@/tools/goods";
	import secondHandTag from "@/components/secondHandTag/index.vue";

	let sysHeight = uni.getSystemInfoSync().statusBarHeight;
	import zbCode from '@/components/zb-code/zb-code.vue'
	import {
		getProductDetail,
		getProductCtivity,
		getProductRecommend,
		getProductCode,
		collectAdd,
		collectDel,
		postCartAdd,
		getProductStoreDetail,
		getSimilarProductList
	} from '@/api/store.js';
	import {
		getUserInfo,
		userShare,
		getUserAgreement,
		loginH5
	} from '@/api/user.js';
	import { getCoupons } from '@/api/api.js';
	import { getCartCounts } from '@/api/order.js';
	import { toLogin } from '@/libs/login.js';
	import { mapGetters } from 'vuex';
	import { getAliChat, imageBase64 } from '@/api/public';
	import countDown from '@/components/countDown';
	import productConSwiper from '@/components/productConSwiper';
	import productWindow from '@/components/productWindow';
	import specs from '@/components/specs/index.vue';
	import userEvaluation from '@/components/userEvaluation';
	import shareRedPackets from './components/shareRedPackets/index.vue';
	import kefuIcon from '@/components/kefuIcon';
	import cusPreviewImg from '@/components/cusPreviewImg';
	import homeList from '@/components/homeList'
	import serviceModal from './components/serviceModal/index.vue';
	import preferentialModal from './components/preferentialModal/index.vue';
	import oldDescModal from './components/oldDescModal/index.vue';
	import specModal from './components/specModal/index.vue';
	import alipayChat from '@/components/alipayChat'
	import chatModal from '@/components/chatModal'

	import { silenceBindingSpread } from '@/utils';
	import {
		TOKENNAME,
		HTTP_REQUEST_URL
	} from '@/config/app.js';
	import {
		Debounce
	} from '@/utils/validate.js'

	let app = getApp();
	import colors from "@/mixins/color";
	import { tradeCreate } from "../../api/order";
	import { createQuickOrder, getLeaseDesc, lightData } from "../../api/leaseOrder";
	import parser from "@/components/jyf-parser/jyf-parser";
	import { lightsData } from "@/utils/order";
	import publicFAQ from "@/pages/extension/customer/publicFAQ.vue";
	export default {
		components: {
			publicFAQ,
			chatModal,
			specModal,
			alipayChat,
			oldDescModal,
			"jyf-parser": parser,
			zbCode,
			productConSwiper,
			productWindow,
			userEvaluation,
			shareRedPackets,
			kefuIcon,
			cusPreviewImg,
			specs,
			countDown,
			homeList,
			serviceModal,
			preferentialModal,
			secondHandTag
		},
		directives: {
			trigger: {
				inserted(el, binging) {
					el.click();
				}
			}
		},
		mixins: [colors],
		data() {
			let that = this;
			return {
				similarProductList: [],
				similarInit: false,
				initProduct: {}, // 初始商品信息

				topBarHeight: 0,
				specModalShow: false,

				aliChat: {},
				livePicture: [],
				storeSkuCheck: {},
				isStoreSkuCheck: 0,
				from: '',
				pid: '',
				leaseDesc: '',
				oldDescModalShow: false,
				showDetail: false,
				freight: '0',
				// 快捷下单
				timeRange: '', // 自定义时间
				quickDuration: '', // 租赁天数
				coupon_id: '',
				stickyTop: '',
				addService: [], //增值服务
				related: [], //卡项服务
				showSkeleton: true, //骨架屏显示隐藏
				isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
				//属性是否打开
				coupon: { type: -1, list: [], count: [] },
				tabsIndex: 0,
				agreement: [],
				animated: false, //购物车动画
				id: 0, //商品id
				replyCount: 0, //总评论数量
				reply: [], //评论列表
				storeInfo: { brand_name: '' }, //商品详情
				cart_num: 1, //购买数量
				isOpen: false, //是否打开属性组件
				actionSheetHidden: true,
				posterImageStatus: false,
				storeImage: '', //海报产品图
				PromotionCode: '', //二维码图片
				canvasStatus: false, //海报绘图标签
				posterImage: '', //海报路径
				posterbackgd: '/static/images/posterbackgd.png',
				sharePacket: {
					isState: true //默认不显示
				}, //分销商详细
				uid: 0, //用户uid
				circular: false,
				autoplay: false,
				interval: 3000,
				duration: 500,
				good_list: [],
				replyChance: 0,
				CartCount: 0,
				isDown: true,
				posters: false,
				weixinStatus: false,
				ensureInfo: {
					show: false,
					ensure: [],
					ensureTitle: ''
				},
				specsInfo: {
					show: false,
					specs: [],
					specsTitle: ''
				},
				discountInfo: {
					show: false,
					discount: []
				},
				attr: {
					goodsType: 'lease', // 商品类型
					goodsTypeSelect: 'lease', // 选择的类型
					cartAttr: false, // 显示规格弹窗
					productAttr: {
						mall: '', // 商城规格属性
						lease: '' // 租赁规格属性
					},
					productSelect: {
						mall: {}, // 商城规格选中值
						lease: {} // 租赁规格选中值
					},
					deliveryType: [], // 配送方式
					isType: 0,
					relation_id: 0
				},
				//商品规格key拼接 列表
				productValue: {
					mall: [],
					lease: []
				},

				limitInfo: {
					discount_price: 0,
					price: 0,
					discount: 1,
					datatime: 0
				},
				promotions_type: 0,
				description: '',
				H5ShareBox: false, //公众号分享图片
				activity: [],
				lock: false,
				scrollTop: 0,
				tagStyle: {
					img: 'width:100%;display:block;',
					table: 'width:100%',
					video: 'width:100%'
				},
				returnShow: true, //判断顶部返回是否出现
				diff: '',
				is_money_level: 1,
				is_vip: 0, //是否是会员
				routineContact: 0,
				discountsData: [], //套餐数据
				siteName: '', //商城名称
				themeColor: '',
				fontColor: '',
				isMention: false, //是否存在到店自提
				showAnimate: true,
				// sku 展示
				skuArr: {
					mall: [], // sku 商城展示
					lease: [] // sku 租赁展示
				},
				// sku 选中值
				selectSku: {
					mall: [], // sku 商城选中值
					lease: [] // sku 租赁选中值
				},
				attrTxt: '请选择', //属性页面提示
				//已选属性key
				attrValue: {
					mall: '',
					lease: ''
				},
				//二维码参数
				codeShow: false,
				cid: '1',
				codeVal: "", // 要生成的二维码值
				size: 200, // 二维码大小
				unit: 'upx', // 单位
				background: '#FFF', // 背景色
				foreground: '#000', // 前景色
				pdground: '#000', // 角标色
				codeIcon: '', // 二维码图标
				iconsize: 40, // 二维码图标大小
				lv: 3, // 二维码容错级别 ， 一般不用设置，默认就行
				onval: true, // val值变化时自动重新生成二维码
				loadMake: true, // 组件加载完成后自动生成二维码
				base64Show: 0,
				shareQrcode: 0,
				followCode: '',

				currentPage: false,
				sysHeight: sysHeight,
				isShow: 0,
				imgHost: HTTP_REQUEST_URL,
				fromType: 0, //判断是否回退分类二和三刷新
				cartNum: 0,
				addressId: '',
				store_id: '',
				store_name: '',
				delivery_type: 0,
				is_store_buy: 1, //判断平台是否有库存（0：平台有库存；1：平台没有库存）
				is_super_product: 0,
				is_super_user: 0,
				storeList: {},
				activityBg: '',
				posterTitle: '',
				showServiceDrawer: false,
				showPerferentDrawer: false,
				pageScrollStatus: false,
				cartType: '',
				computedPrice: {
					deduction: {
						day_price: 0, // 页面展示的金额
						pay_price: 0,
						sum_price: 0,
						vip_price: 0
					}
				},
				isSwiper: true, //默认展示轮播图
				productSwiper: [], //轮播图复制空间
				productVideoLink: '', //轮播图视频链接复制空间
				userInfo: {},
				storeId: 0, //跳转门店列表切换时获取门店id
			};
		},
		filters: {
			rankType(val) {
				let obj = {
					1: '销量排行榜',
					2: '好评排行榜',
					3: '收藏排行榜'
				};
				return obj[val]
			}
		},
		computed: {
			...mapGetters(['isLogin', 'diyProduct']),
			showVip() {
				return !this.is_money_level && this.storeInfo.vip_price && this.storeInfo.is_vip && this.diyProduct.showSvip
			},
			cardBg() {
				return `url(${this.activityBg})`
			},
			showVipPrice() {
				if (this.storeInfo.vip_price > 0 && this.storeInfo.is_vip == 1 && this.storeInfo.price_type == 'member') {
					return true
				}
			},
			computedPayPrice() {
				return this.computedPrice.deduction.pay_price
			},
			navBarStyle() {
				return {
					// transparent
					background: this.pageScrollStatus ? '#fff' : 'transparent',
					paddingTop: (this.sysHeight) * 2 + 'rpx'
				}
			},
			// #ifdef MP
			shareButtonStyleZfb() {
				let res = uni.getMenuButtonBoundingClientRect();
				return {
					width: res.height + 'px',
					height: res.height + 'px',
					top: res.top + 'px',
					left: (res.left - 70) + 'px'
				}
			},
			menuButtonStyleZfb() {
				let res = uni.getMenuButtonBoundingClientRect();
				return {
					width: 36 + 'px',
					height: res.height + 'px',
					top: res.top + 'px',
					// left: (res.left-108) + 'px',
					left: 40 + 'px',
					borderRadius: res.height + 'px',
				}
			},
			shareButtonStyle() {
				let res = uni.getMenuButtonBoundingClientRect();
				return {
					width: res.height + 'px',
					height: res.height + 'px',
					top: res.top + 'px',
					left: (res.left - 38) + 'px'
				}
			},
			menuButtonStyle() {
				let res = uni.getMenuButtonBoundingClientRect();
				return {
					width: res.width + 'px',
					height: res.height + 'px',
					top: res.top + 'px',
					left: '11px',
					borderRadius: res.height + 'px',
				}
			}
			// #endif
		},
		watch: {
			isLogin: {
				handler: function(newV, oldV) {
					if (newV == true) {
						this.getCartCount();
					}
				},
				deep: true
			},
		},
		onLoad(options) {
			console.log('商品详情参数', options)
			// 解析支付宝二维码多个参数
			if (options?.params) {
				options = { ...options, ...(JSON.parse(options.params)) }
				console.log('解析支付宝二维码多个参数', options)
				this.from = options?.from
				this.pid = options?.pid
				// 活动类型
				getApp().globalData.tag = options?.tag
			}
			// 商品分享，从onLaunch取参数id
			if (app.globalData.goodsId) {
				options.id = app.globalData.goodsId
			}
			let that = this;
			var pages = getCurrentPages();
			// 判断顶部返回是否出现
			that.returnShow = pages.length === 1 ? false : true;
			that.id = options.id;
			// 没用到
			that.isShow = options.isShow;
			// 推广类型
			that.promotions_type = options.promotions_type || 0;
			//判断是否回退分类二和三刷新，从分类里进入此页面
			that.fromType = options.fromType;
			//扫码携带参数处理
			// #ifdef MP
			if (options.scene) {
				let value = that.$util.getUrlParams(decodeURIComponent(options.scene));
				if (value.id) options.id = value.id;
				//记录推广人uid
				if (value.spid) app.globalData.spid = value.spid;
			}
			if (!options.id) {
				this.showSkeleton = false;
				return that.$util.Tips({
					title: '缺少参数无法查看商品'
				}, {
					tab: 3,
					url: 1
				});
			} else {
				that.id = options.id;
			}
			// 获取产品分销二维码：小程序二维码
			if (that.isLogin && options.id) {
				that.downloadFilePromotionCode();
			}
			// #endif

			//记录推广人uid
			if (options.spid) app.globalData.spid = options.spid;

			// 获取商品详情
			that.getGoodsDetails();

			// #ifdef H5
			that.isLogin && silenceBindingSpread();
			// #endif
			// 没用到
			this.colorData();

			this.$nextTick(() => {
				let query = uni.createSelectorQuery();
				query.select('.nav-bar').boundingClientRect().exec((res) => {
					this.stickyTop = res[0].height;
				});
			});
			// 灯火数据
			lightsData(options)
			this.getAliChat()
			uni.setNavigationBar({
				frontColor: '#000',
				backgroundColor: '#fff',
			})
		},
		onReady: function() {
			// todo 未知
			this.isNodes++;
			// #ifdef H5
			this.codeVal = window.location.origin + '/pages/goods_details/index?id=' + this.id +
				'&spid=' + this.$store.state.app.uid
			// #endif
			// #ifdef APP-PLUS
			this.codeVal = HTTP_REQUEST_URL + '/pages/goods_details/index?id=' + this.id +
				'&spid=' + this.$store.state.app.uid
			// #endif
		},
		onShow() {
			// todo 未知
			uni.removeStorageSync('form_type_cart');
		},
		mounted() {
			// todo 未知
			uni.$on('activeFn', data => {
				if (data) {
					this.storeList = data;
					this.storeId = data.id;
				}
				// let id = data.id;
				// this.store_id = id;
				// this.$refs.productWindow.getList(id);
			})
			this.getTopBarHeight()
		},
		/**
		 * 用户点击右上角分享
		 */
		// #ifdef MP
		onShareAppMessage: function() {
			let that = this;
			that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
			userShare();
			return {
				title: that.storeInfo.store_name || '',
				imageUrl: that.storeInfo.image || '',
				path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
			};
		},
		onShareTimeline() {
			let that = this;
			that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
			userShare();
			return {
				title: that.storeInfo.store_name || '',
				imageUrl: that.storeInfo.image || '',
				path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
			};
		},
		// #endif
		methods: {
			selectSimilarProduct(id) {
				this.id = id
				// 刷新sku弹窗
				this.storeInfo.id = ''
				this.getGoodsDetails()
			},
			getSimilarProductList() {
				getSimilarProductList({
					brand_com: this.storeInfo.brand_com,
					product_id: this.storeInfo.id
				}).then(res => {
					if (res.status === 200) {
						this.similarProductList = res.data || []
					}
				})
			},
			setSimilarProduct() {
				if (this.similarInit) return
				this.similarInit = true
				this.initProduct = {
					id: this.storeInfo.id,
					image: this.storeInfo.image,
					relation_id: this.storeInfo.relation_id,
				}
				// 初始商品为门店商品，则不显示相似商品
				if (this.initProduct.relation_id > 0) {
					return
				}
				this.getSimilarProductList()
			},

			goZero() {
				uni.navigateTo({
					url: `/pages/users/zero_bag/index`
				})
			},
			getTopBarHeight() {
				let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
				this.topBarHeight = menuButtonInfo.top + menuButtonInfo.height;
			},
			// 跳转租赁流程的位置
			goLeaseDesc() {
				this.tabsIndex = 1; // 切换到租赁流程 Tab
				uni.createSelectorQuery()
					.select('#past3') // 选择目标节点
					.boundingClientRect(res => {
						if (res) {
							uni.pageScrollTo({
								scrollTop: res.top, // 距离页面顶部的距离
								duration: 300 // 滚动时间，单位 ms
							});
						}
					})
					.exec();
			},
			// 获取支付宝客服
			getAliChat() {
				getAliChat().then(res => {
					if (res.status === 200) {
						this.aliChat = res.data || {}
					}
				})
			},
			// 预览实拍图
			previewImage(index) {
				uni.previewImage({
					current: index, // 当前显示图片的索引
					urls: this.livePicture, // 所有图片路径组成的数组
					success: () => {
						console.log('预览成功');
					},
					fail: (err) => {
						console.error('预览失败', err);
					}
				});
			},

			// 显示规格key别名
			getAttrValueAlias() {
				return attrValueAlias(this.attrValue[this.attr.goodsTypeSelect], this.attr.productAttr[this.attr.goodsTypeSelect])
			},

			// 展示金额:标题上面
			getPrice,

			// 获取配送方式
			deliveryFun(e) {
				this.delivery_type = e;
			},
			// 获取配送地址id
			onAddressId(row) {
				this.addressId = row.id
			},
			// 门店：详情
			getStoreDetail(id, pid) {
				getProductStoreDetail(pid ? pid : this.id, { store_id: id }).then(res => {
					let storeInfo = res.data.storeInfo;
					this.$set(this, 'storeInfo', storeInfo);
					// this.$set(this, 'productValue.mall', res.data.productValue);
					this.productValue[this.attr.goodsTypeSelect] = res.data.productValue
					this.DefaultSelect('lease');
					this.DefaultSelect('mall');
					// this.DefaultSelectLease();
				}).catch(err => {
					return this.$util.Tips({
						title: err
					});
				})
			},
			// 门店：获取自提地址id
			onstoreId(row, flag) {
				this.storeList = row;
				if (flag == 2 || flag == 3) {
					this.store_id = row.id;
					this.store_name = row.name;
					this.getStoreDetail(row.id);
				} else {
					this.getStoreDetail(0, this.storeInfo.pid);
				}
			},
			/*
			 * 门店：跳转门店列表
			 */
			showStoreList: function() {
				let id = this.storeInfo.pid ? this.storeInfo.pid : this.storeInfo.id
				uni.navigateTo({
					url: '/pages/store/list/index?type=1&isCollage=1&storeId=' + this.storeList.id + '&product_id=' + id
				})
			},
			// 商品评论：未登录跳转，已经
			changeLogin() {
				// toLogin()
			},
			seeEnsure() {
				this.ensureInfo.show = true;
			},
			// todo 未知
			seeSpecs() {
				this.specsInfo.show = true;
			},
			seeDiscount() {
				this.discountInfo.show = true;
			},
			// 自定义导航栏
			moreNav() {
				this.currentPage = !this.currentPage
			},
			// 选择规格：点击sku图片打开轮播图
			showImg(index) {
				this.$refs.cusPreviewImg.open(this.selectSku[this.attr.goodsTypeSelect].suk)
			},

			// 选择规格：滑动规格弹窗轮播图选择商品，或者，点击banner下面的缩略图
			changeSwitch(e) {
				let productSelect = this.skuArr[this.attr.goodsTypeSelect][e];
				// this.$set(this, 'selectSku', productSelect);
				this.selectSku[this.attr.goodsTypeSelect] = productSelect
				var skuList = productSelect.suk.split(',');
				skuList.forEach((i, index) => {
					this.$set(this.attr.productAttr[this.attr.goodsTypeSelect][index], 'index', skuList[index]);
				})
				if (productSelect) {
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'image', productSelect.image);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'price', productSelect.price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'day_price', productSelect.day_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'buyout_money', productSelect.buyout_money);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'buyout_final_money', productSelect.buyout_final_money);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'stock', productSelect.stock);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'unique', productSelect.unique);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'cart_num', 1);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'vip_price', productSelect.vip_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'vip_day_price', productSelect.vip_day_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'id', productSelect.id);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'params', productSelect);
					// this.$set(this, 'attrValue', productSelect.suk);
					this.attrValue[this.attr.goodsTypeSelect] = productSelect.suk
					this.$set(this, 'attrTxt', '已选择');
				}
			},
			// 获取小程序二维码
			qrR(res) {
				// #ifdef H5
				if (!this.$wechat.isWeixin() || this.shareQrcode != '1') {
					this.PromotionCode = res;
					this.followCode = ''
				}
				// #endif
				// #ifdef APP-PLUS
				this.PromotionCode = res;
				// #endif
			},
			// 用不到
			boxStatus(data) {
				this.showAnimate = data
			},
			// 用不到
			followWX() {
				getProductCode(this.id).then(res => {
					this.followCode = res.data.code
					this.getImageBase64(1);
				}).catch(err => {
					this.$util.Tips({
						title: err
					});
				})
			},
			// todo 图片预览；
			getpreviewImage: function() {
				if (this.posterImage) {
					let photoList = [];
					photoList.push(this.posterImage)
					uni.previewImage({
						urls: photoList,
						current: this.posterImage
					});
				} else {
					this.$util.Tips({
						title: '您的海报尚未生成'
					});
				}
			},
			videoPause() {

			},
			// app分享
			// #ifdef APP-PLUS
			appShare(scene) {
				let that = this
				let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
				let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由，也就是最后一个打开的页面路由
				uni.share({
					provider: "weixin",
					scene: scene,
					type: 0,
					href: `${HTTP_REQUEST_URL}${curRoute}&spid=${that.uid}`,
					title: that.storeInfo.store_name,
					summary: that.storeInfo.store_info,
					imageUrl: that.storeInfo.small_image,
					success: function(res) {
						// uni.showToast({
						// 	title: '分享成功',
						// 	icon: 'success'
						// })
						// that.posters = false;
					},
					fail: function(err) {
						uni.showToast({
							title: '分享失败',
							icon: 'none',
							duration: 2000
						})
						// that.posters = false;
					}
				});
			},
			// #endif

			// 用不到
			closeChange: function() {
				this.$set(this.sharePacket, 'isState', true);
			},

			// todo 拼团
			goActivity: function(e) {
				let item = e;
				if (item.type == 1) {
					uni.navigateTo({
						url: `/pages/activity/goods_details/index?id=${item.id}&type=1&time=${item.time}&status=1`
					});
				} else if (item.type == 2) {
					uni.navigateTo({
						url: `/pages/activity/goods_bargain_details/index?id=${item.id}&spid=${this.uid}`
					});
				} else {
					uni.navigateTo({
						url: `/pages/activity/goods_details/index?id=${item.id}&type=3`
					});
				}
			},
			// 选择规格：购物车手动填写数量
			iptCartNum: function(e) {
				this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'cart_num', e);
			},
			// 自定义导航栏：返回
			backTap() {
				let pages = getCurrentPages(); // 获取当前打开过的页面路由数，
				if (pages.length > 1) {
					uni.navigateBack()
				} else {
					uni.switchTab({
						url: '/pages/index/index'
					});
				}
			},
			/*
			 * 没用到：去商品详情页
			 */
			goDetail(item) {
				if (item.activity.length == 0) {
					uni.redirectTo({
						url: '/pages/goods_details/index?id=' + item.id
					});
					return;
				}
				// 砍价
				if (item.activity && item.activity.type == 2) {
					uni.redirectTo({
						url: `/pages/activity/goods_bargain_details/index?id=${item.activity.id}&spid=${this.uid}`
					});
					return;
				}
				// 拼团
				if (item.activity && item.activity.type == 3) {
					uni.redirectTo({
						url: `/pages/activity/goods_details/index?id=${item.activity.id}&type=3`
					});
					return;
				}
				// 秒杀
				if (item.activity && item.activity.type == 1) {
					uni.redirectTo({
						url: `/pages/activity/goods_details/index?id=${item.activity.id}&type=1&time=${item.activity.time}&status=1`
					});
					return;
				}
			},
			/*
			 * 获取用户信息
			 */
			getUserInfo: function() {
				let that = this;
				getUserInfo().then(res => {
					that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != 0 ? false : true);
					that.$set(that, 'uid', res.data.uid);
					that.$set(that, 'is_money_level', res.data.is_money_level);
					that.userInfo = res.data;
				});
			},
			/**
			 * 购物车数量加和数量减
			 *
			 */
			ChangeCartNum: function(changeValue) {
				//changeValue:是否 加|减
				//获取当前变动属性
				let productSelect = this.productValue[this.attr.goodsTypeSelect][this.attrValue[this.attr.goodsTypeSelect]];
				//如果没有属性,赋值给商品默认库存
				if (productSelect === undefined && !this.attr.productAttr[this.attr.goodsTypeSelect].length) productSelect = this.attr
					.productSelect[this.attr.goodsTypeSelect];
				//无属性值即库存为0；不存在加减；
				if (productSelect === undefined) return;
				let stock = productSelect.stock || 0;
				let num = this.attr.productSelect[this.attr.goodsTypeSelect];
				if (changeValue) {
					num.cart_num++;
					if (num.cart_num > stock) {
						this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'cart_num', stock ? stock : 1);
						this.$set(this, 'cart_num', stock ? stock : 1);
					}
				} else {
					num.cart_num--;
					if (num.cart_num < 1) {
						this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'cart_num', 1);
						this.$set(this, 'cart_num', 1);
					}
				}
			},
			// sku小图：点击选规格
			selectSwiper() {
				this.isSwiper = true;
				this.$set(this, 'productSwiper', this.storeInfo.slider_image);
				this.$set(this, 'productVideoLink', this.storeInfo.video_link);
			},
			// sku小图：点击选规格
			changeAttrPic(item, index) {
				this.isSwiper = false;
				this.ChangeAttr(item.suk);
				this.changeSwitch(index);
				this.$set(this, 'productVideoLink', '');
				this.$set(this, 'productSwiper', [item.image]);
			},
			// 选择规格：点击规格
			attrVal(val) {
				this.$set(this.attr.productAttr[this.attr.goodsTypeSelect][val.indexw], 'index', this.attr.productAttr[this.attr.goodsTypeSelect][val.indexw].attr_values[val.indexn]);
			},
			/**
			 * 选择规格：属性变动赋值
			 *
			 */
			ChangeAttr: function(res) {
				let productSelect = this.productValue[this.attr.goodsTypeSelect][res];
				// this.$set(this, "selectSku", productSelect);
				this.selectSku[this.attr.goodsTypeSelect] = productSelect

				if (productSelect && productSelect.stock >= 0) {
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'delivery_price', productSelect.delivery_price);
					this.$set(this.computedPrice.deduction, 'pay_price', productSelect.delivery_price);
					this.$set(this.computedPrice.deduction, 'day_price', productSelect.day_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'image', productSelect.image);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'price', productSelect.price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'day_price', productSelect.day_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'buyout_money', productSelect.buyout_money);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'buyout_final_money', productSelect.buyout_final_money);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'stock', productSelect.stock);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'unique', productSelect.unique);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'cart_num', 1);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'vip_price', productSelect.vip_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'vip_day_price', productSelect.vip_day_price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'id', productSelect.id);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'params', productSelect);
					// this.$set(this, 'attrValue', res);
					this.attrValue[this.attr.goodsTypeSelect] = res
					this.$set(this, 'attrTxt', '已选择');
				} else {
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'delivery_price', this.storeInfo.price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'image', this.storeInfo.image);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'price', this.storeInfo.price);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'stock', 0);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'unique', '');
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'cart_num', 0);
					this.$set(this.attr.productSelect[this.attr.goodsTypeSelect], 'vip_price', this.storeInfo.vip_price);
					// this.$set(this, 'attrValue', '');
					this.attrValue[this.attr.goodsTypeSelect] = ''
					this.$set(this, 'attrTxt', '请选择');
				}
			},
			// 推荐商品
			getGoodsList() {
				let that = this;
				getProductRecommend(that.id).then(res => {
					that.good_list = res.data || [];

				}).catch(err => {
					return this.$util.Tips({
						title: err
					});
				})
			},
			// 获取产品活动详情
			getGoodsCtivity() {
				let that = this;
				getProductCtivity(that.id, {
					promotions_type: this.promotions_type
				}).then(res => {
					that.$set(that, 'activityBg', res.data.activity_background.image || '');
					that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
					that.$set(that, 'discountsData', res.data.discounts_products ? res.data.discounts_products : []); //套餐数据
					let promotions = res.data.promotions[0];
					that.$set(that, 'promotions_type', res.data.promotions.length ? promotions.promotions_type : 0);
					if (res.data.promotions.length && promotions.promotions_type == 1) {
						let discount = that.$util.$h.Div(promotions.discount, 100);
						let discountPrice = that.$util.$h.Mul(discount, this.storeInfo.price);
						that.$set(that.limitInfo, 'price', this.storeInfo.price || 0);
						that.$set(that.limitInfo, 'datatime', promotions.stop_time || 0);
						that.$set(that.limitInfo, 'discount', discount);
						that.$set(that.limitInfo, 'discount_price', discountPrice);
					}
					that.$set(that.discountInfo, 'discount', res.data.promotions);
					res.data.coupons.map(item => {
						this.$set(item, 'ruleshow', false);
					})
					that.$set(that.coupon, 'list', res.data.coupons);
					that.$set(that, 'computedPrice', res.data.computed);
				}).catch(err => {
					return this.$util.Tips({
						title: err
					});
				})

			},
			/* 获取租赁须知等 */
			getAgreement() {
				const list = [
					getUserAgreement('leaseFlow'), // 租赁流程
					getUserAgreement('leaseProject'), // 租赁方案
					getUserAgreement('leaseNotice'), // 租赁须知
					getUserAgreement('leaseQuestion') // 租赁常见问题
				]
				Promise.all(list).then(res => {
					res.forEach(e => this.agreement.push(e.data.content))
				})
			},
			/**
			 * 获取产品详情
			 *
			 */
			getGoodsDetails: function() {
				uni.showLoading({
					title: '加载中...'
				});
				this.getAgreement()
				let that = this;
				getProductDetail(that.id, {
						promotions_type: this.promotions_type,
						pid: this.pid,
						from: this.from
					})
					.then(res => {
						uni.hideLoading();
						// 快捷下单
						// if(res.data.storeInfo.is_quickOrder==1){
						//   // 关闭当前页面栈，并跳转插件
						//   uni.navigateBack({delta: 1})
						//   my.navigateTo({
						//     url:`plugin://goodsDetailPlugin/rentGoodsDetail?outItemId=${res.data.storeInfo.id}`//outItemId：必填，商品编码
						//   })
						// }
						// this.showDetail=true

						// 实拍图
						if (res.data.storeInfo.snapshot) {
							let a = JSON.parse(res.data.storeInfo.snapshot)
							this.livePicture = a.split(',')
						}


						// 清除商品分享id
						app.globalData.goodsId = ''
						// 区分商品类型
						if (res.data.storeInfo.lease_type == 0) {
							this.attr.goodsType = 'All';
							this.attr.goodsTypeSelect = 'lease'
						} else if (res.data.storeInfo.lease_type == 1) {
							this.attr.goodsType = 'lease';
							this.attr.goodsTypeSelect = 'lease'
						} else if (res.data.storeInfo.lease_type == 2) {
							this.attr.goodsType = 'mall';
							this.attr.goodsTypeSelect = 'mall'
						}

						// 门店信息处理
						let storeInfo = res.data.storeInfo;
						if (storeInfo.type == 1) {
							if (storeInfo.delivery_type.indexOf('1') != -1) { //在门店首页确保选择门店配送或是自提
								storeInfo.delivery_type.sort((x, y) => x - y);
								storeInfo.delivery_type.push(storeInfo.delivery_type.shift());
							}
						} else {
							storeInfo.delivery_type.sort((x, y) => x - y);
						}

						// 配送方式
						that.$set(that.attr, 'deliveryType', storeInfo.delivery_type);
						// 是否到店自提
						if (res.data.storeInfo.delivery_type.indexOf('2') != -1) {
							that.$set(that, 'isMention', true);
						}
						// 判断平台是否有库存（0：平台有库存；1：平台没有库存）
						that.$set(that, 'is_store_buy', res.data.is_store_buy || 0);
						that.$set(that, 'storeInfo', storeInfo);
						that.$set(that.attr, 'isType', res.data.storeInfo.type);
						that.$set(that.attr, 'relation_id', res.data.storeInfo.relation_id);
						that.$set(that, 'productSwiper', storeInfo.slider_image);
						that.$set(that, 'productVideoLink', storeInfo.video_link);
						that.$set(that, 'is_super_user', res.data.is_super_user || 0);
						that.$set(that, 'is_super_product', res.data.is_super_product || 0);

						// 处理确认信息
						that.$set(that.ensureInfo, 'ensure', storeInfo.ensure);
						let ensureTitle = [],
							specsTitle = [];
						storeInfo.ensure.forEach(res => {
							ensureTitle.push(res.name)
						})
						storeInfo.specs.forEach(res => {
							specsTitle.push(res.name)
						})
						that.$set(that.ensureInfo, 'ensureTitle', ensureTitle.join(' · '));

						// todo 处理信息
						that.$set(that.specsInfo, 'specsTitle', specsTitle.join(' · '));
						that.$set(that.specsInfo, 'specs', storeInfo.specs);

						// 详情描述
						that.$set(that, 'description', storeInfo.description);
						if (this.description) {
							this.description = this.description.replace(
								/<img/gi, '<img style="max-width:100%;height:auto;float:left;display:block" '
							);
							this.description = this.description.replace(
								/<video/gi, '<video style="width:100%;height:auto;display:block" '
							);
						}

						// 商城规格，租赁规格
						this.attr.productAttr.mall = res.data.productAttr
						this.attr.productAttr.lease = res.data.productAttrLease
						this.productValue.mall = res.data.productValue
						this.productValue.lease = res.data.productValueLease
						if (this.attr.goodsType === 'All') {
							this.setSku('lease')
							this.setSku('mall')
							// 选中属性
							this.DefaultSelect('lease');
							this.DefaultSelect('mall');
						}
						if (this.attr.goodsType === 'lease') {
							this.setSku('lease')
							this.DefaultSelect('lease');
						} else if (this.attr.goodsType === 'mall') {
							this.setSku('mall')
							this.DefaultSelect('mall');
						}
						// console.log(this.skuArr,this.selectSku)


						// // sku列表显示 默认租赁
						// if(this.attr.goodsType==='All'||this.attr.goodsType==='lease'){
						//   // sku选中 默认租赁第一个
						//   this.$set(this, "selectSku", that.skuArr.lease[0]);
						// }else if(this.attr.goodsType==='mall'){
						//   // sku选中 默认租赁第一个
						//   this.$set(this, "selectSku", that.skuArr.mall[0]);
						// }

						// 显示vip
						that.$set(that, 'is_vip', res.data.storeInfo.is_vip);
						// 商城名称
						that.siteName = res.data.site_name;
						that.posterTitle = res.data.product_poster_title;
						// 评论列表
						that.$set(that, 'reply', res.data.reply);
						that.$set(that, 'replyCount', res.data.replyCount);
						that.$set(that, 'replyChance', res.data.replyChance);

						// 分享相关
						that.$set(that.sharePacket, 'priceName', res.data.priceName);
						that.$set(that, 'shareQrcode', res.data.share_qrcode);

						// 客服相关
						that.$set(that, 'routineContact', Number(res.data.routine_contact_type));

						// 门店名称
						// uni.setNavigationBarTitle({
						//   title: storeInfo.store_name.substring(0, 13) + '...'
						// });

						// 会员可以省多少钱
						that.$set(that, 'diff', that.$util.$h.Sub(storeInfo.price, storeInfo.vip_price));

						// 推荐商品
						that.getGoodsList();
						// 获取产品活动详情
						that.getGoodsCtivity();
						// #ifdef H5
						that.$set(that, 'storeImage', that.storeInfo.image);
						that.ShareInfo();
						if (this.$wechat.isWeixin() && this.shareQrcode == '1') {
							that.followWX();
						} else {
							that.getImageBase64();
						}
						// #endif
						if (that.isLogin) {
							that.getUserInfo();
						}
						// #ifndef H5
						//获取海报产品图
						that.downloadFilestoreImage();
						// #endif


						// 购物车数量
						that.getCartCount();
						// 海报
						that.preloadImage();

						// 骨架屏隐藏
						setTimeout(() => {
							this.showSkeleton = false
						}, 200)
					}).catch(err => {
						//状态异常返回上级页面
						return that.$util.Tips({
							title: err.toString()
						}, {
							tab: 3,
							url: 1
						});
						setTimeout(() => {
							this.showSkeleton = false
						}, 500)
					}).finally(() => {
						this.getLeaseDesc()

						// 初始化：获取相似商品（只执行一次）
						this.setSimilarProduct()
						// this.goLease()
					})
			},
			// 设置sku
			setSku(goodsType) {
				// sku
				for (let key in this.productValue[goodsType]) {
					let obj = this.productValue[goodsType][key];
					this.skuArr[goodsType].push(obj)
				}
				if (!this.skuArr[goodsType].length) {
					this.skuArr[goodsType] = [{
						image: this.storeInfo.image,
						suk: this.storeInfo.store_name,
						price: this.storeInfo.price
					}];
				}
				// sku选中第一个
				this.selectSku[goodsType] = this.skuArr[goodsType][0]
			},
			// 海报
			preloadImage: function() {
				// 预加载海报生成动图
				let that = this;
				uni.downloadFile({
					url: that.imgHost + '/statics/images/poster_loading.png',
					success: function(res) {
						// 图片下载成功，可以暂存图片路径或进行其他操作
						console.log('Image preloaded:', res.tempFilePath);
					},
				});
			},
			/**
			 *  商城 默认选中属性
			 *
			 */
			DefaultSelect: function(goodsType) {
				let productAttr = this.attr.productAttr[goodsType];

				let valueobj = []; // 临时存储规格变量
				let value = [];
				// 默认显示第一个有库存的商品
				for (var key in this.productValue[goodsType]) {
					if (this.productValue[goodsType][key].stock > 0) {
						valueobj = this.attr.productAttr[goodsType].length ? key.split(',') : [];
						break;
					}
				}
				// 全都没有库存：默认选中第一个
				if (!valueobj.length && this.attr.productAttr[goodsType].length) {
					value = Object.keys(this.productValue[goodsType])[0].split(',');
				} else {
					value = valueobj;
				}
				for (let i = 0; i < productAttr.length; i++) {
					this.$set(productAttr[i], 'index', value[i]);
				}

				//sort();排序函数:数字-英文-汉字；
				let productSelect = this.productValue[goodsType][value.join(',')];
				this.$set(this.attr.productSelect[goodsType], 'store_name', this.storeInfo.store_name);
				if (productSelect && productAttr.length) {
					this.$set(this.attr.productSelect[goodsType], 'delivery_price', productSelect.delivery_price);
					this.$set(this.attr.productSelect[goodsType], 'image', productSelect.image);
					this.$set(this.attr.productSelect[goodsType], 'price', productSelect.price);
					this.$set(this.attr.productSelect[goodsType], 'day_price', productSelect.day_price);
					this.$set(this.attr.productSelect[goodsType], 'buyout_money', productSelect.buyout_money);
					this.$set(this.attr.productSelect[goodsType], 'buyout_final_money', productSelect.buyout_final_money);
					this.$set(this.attr.productSelect[goodsType], 'vip_price', productSelect.vip_price);
					this.$set(this.attr.productSelect[goodsType], 'vip_day_price', productSelect.vip_day_price);
					this.$set(this.attr.productSelect[goodsType], 'stock', productSelect.stock);
					this.$set(this.attr.productSelect[goodsType], 'unique', productSelect.unique);
					this.$set(this.attr.productSelect[goodsType], 'cart_num', 1);
					this.$set(this.attr.productSelect[goodsType], 'id', productSelect.id);
					this.$set(this.attr.productSelect[goodsType], 'params', productSelect);

					// this.$set(this, 'attrValue', value.join(','));
					this.attrValue[goodsType] = value.join(',')

					this.$set(this.attr.productSelect[goodsType], 'vip_price', productSelect.vip_price);
					this.$set(this, 'attrTxt', '已选择');
				} else if (!productSelect && productAttr.length) {
					this.$set(this.attr.productSelect[goodsType], 'delivery_price', this.storeInfo.price);
					this.$set(this.attr.productSelect[goodsType], 'image', this.storeInfo.image);
					this.$set(this.attr.productSelect[goodsType], 'price', this.storeInfo.price);
					this.$set(this.attr.productSelect[goodsType], 'stock', 0);
					this.$set(this.attr.productSelect[goodsType], 'unique', '');
					this.$set(this.attr.productSelect[goodsType], 'cart_num', 0);
					this.$set(this.attr.productSelect[goodsType], 'vip_price', this.storeInfo.vip_price);
					// this.$set(this, 'attrValue', '');
					this.attrValue[goodsType] = ''
					this.$set(this, 'attrTxt', '请选择');
				} else if (!productSelect && !productAttr.length) {
					setTimeout(() => {
						this.$set(this.attr.productSelect[goodsType], 'delivery_price', this.computedPayPrice);
					}, 1000)
					this.$set(this.attr.productSelect[goodsType], 'image', this.storeInfo.image);
					this.$set(this.attr.productSelect[goodsType], 'price', this.storeInfo.price);
					this.$set(this.attr.productSelect[goodsType], 'stock', this.storeInfo.stock);
					this.$set(this.attr.productSelect[goodsType], 'unique', this.storeInfo.unique || '');
					this.$set(this.attr.productSelect[goodsType], 'cart_num', 1);
					this.$set(this.attr.productSelect[goodsType], 'vip_price', this.storeInfo.vip_price);
					// this.$set(this, 'attrValue', '');
					this.attrValue[goodsType] = ''
					this.$set(this, 'attrTxt', '请选择');
				}
			},

			// 活动优惠
			openPerferentDrawer() {
				this.showPerferentDrawer = true;
			},
			/**
			 *
			 *
			 * 收藏商品
			 */
			setCollect: Debounce(function() {
				if (this.isLogin === false) {
					toLogin();
				} else {
					let that = this;
					if (this.storeInfo.userCollect) {
						collectDel(this.storeInfo.id).then(res => {
							that.$set(that.storeInfo, 'userCollect', !that.storeInfo.userCollect);
							return that.$util.Tips({
								title: res.msg
							});
						});
					} else {
						collectAdd(this.storeInfo.id).then(res => {
							that.$set(that.storeInfo, 'userCollect', !that.storeInfo.userCollect);
							return that.$util.Tips({
								title: res.msg
							});
						});
					}
				}
			}),
			/**
			 * 打开属性插件
			 */
			selecAttr: Debounce(function() {
				// if(!this.isLogin){
				// 	toLogin();
				// 	return
				// }
				if ((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')) {
					this.$refs.productWindow.showLocation();
				}
				this.currentPage = false;
				this.$set(this.attr, 'cartAttr', true);
				this.$set(this, 'isOpen', true);
			}),
			// 规格弹窗：关闭
			onMyEvent: function() {
				this.$set(this.attr, 'cartAttr', false);
				this.$set(this, 'isOpen', false);
			},
			myEnsure() {
				this.$set(this.ensureInfo, 'show', false);
			},
			// 产品参数弹窗：关闭
			mySpecs() {
				this.$set(this.specsInfo, 'show', false);
			},
			myDiscount() {
				this.$set(this.discountInfo, 'show', false);
			},
			// 选择规格：确认 e.type目前用于加入购物车
			onConfirm(e) {
				this.$set(this.attr, 'cartAttr', false);
				this.isOpen = true;
				// 增值服务
				this.addService = e?.addService
				// 卡项商品
				this.related = e?.related
				this.timeRange = e?.timeRange
				this.quickDuration = e?.quickDuration
				this.coupon_id = e?.coupon_id
				// sku门店
				this.storeSkuCheck = e?.storeSkuCheck ? e.storeSkuCheck : ''
				this.isStoreSkuCheck = e?.storeSkuCheck ? 1 : 0


				if (this.cartType == 'cart' || e?.type == 'cart') {
					this.goCat(undefined, 'cart');
				} else {
					this.goCat(true, 'buy');
				}
			},
			/**
			 * 打开属性加入购物车
			 *
			 */
			joinCart: function(e) {
				this.currentPage = false;
				//是否登录
				if (!this.isLogin) {
					toLogin();
				} else {
					this.goCat(undefined, 'cart');
				}
			},
			/*
			 * 加入购物车 or 确认订单
			 */
			goCat: function(news, cartType) {
				if ((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')) {
					this.$refs.productWindow.showLocation();
				}
				let that = this
				// 选中的型号
				let productSelect = that.productValue[this.attr.goodsTypeSelect][this.attrValue[this.attr.goodsTypeSelect]];

				// 操作类型：购物车，确认订单
				this.cartType = cartType;
				// 打开属性弹窗
				if (that.attrValue[this.attr.goodsTypeSelect]) {
					//默认选中了属性，但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
					that.attr.cartAttr = !that.isOpen ? true : false;
				} else {
					if (that.isOpen) that.attr.cartAttr = true;
					else that.attr.cartAttr = !that.attr.cartAttr;
				}
				//只有关闭属性弹窗时进行加入购物车
				if (that.attr.cartAttr === true && that.isOpen === false) return (that.isOpen = true);

				// 以下是加入购物车功能

				//如果有属性,没有选择,提示用户选择
				if (that.attr.productAttr[this.attr.goodsTypeSelect].length && productSelect === undefined && that.isOpen === true)
					return that.$util.Tips({
						title: '产品库存不足，请选择其它属性'
					});
				if (that.attr.productSelect[this.attr.goodsTypeSelect].cart_num <= 0) {
					that.attr.productSelect[this.attr.goodsTypeSelect].cart_num = 1
					that.isOpen = false
					return that.$util.Tips({
						title: '请先选择属性'
					});
				}
				let q = {
					cartNum: that.attr.productSelect[this.attr.goodsTypeSelect].cart_num,
					new: news === undefined ? 0 : 1,
					uniqueId: that.attr.productSelect[this.attr.goodsTypeSelect] !== undefined ? that.attr.productSelect[this.attr.goodsTypeSelect].unique : '',
					store_id: this.store_id,
					addressId: this.addressId,
					delivery_type: this.delivery_type,
					addService: this.addService, // 增值服务
					related: this.related, //卡项服务
					lease_type: this.attr.goodsTypeSelect === 'lease' ? 1 : 2
				};
				// debugger
				// 门店id
				if (that.is_store_buy || this.delivery_type == 2 || this.delivery_type == 3) {
					q.productId = that.storeInfo.id; //重新调用门店详情后的赋值id
				} else {
					q.productId = that.id;
				}
				let delivery_type = that.delivery_type

				// 自定义时间
				if (this.timeRange) {
					q.lease_custom_start = this.timeRange[0]
					q.lease_custom_end = this.timeRange[1]
				}
				// 如果商品参加快捷下单，并且当前规格也是
				// if(this.storeInfo.is_quickOrder==1&&that.attr.productSelect[this.attr.goodsTypeSelect].params.is_checked){
				//   q.is_quickOrder=this.storeInfo.is_quickOrder
				//   q.sku_id=that.attr.productSelect[this.attr.goodsTypeSelect].params.sku_id
				//   q.coupon_id=this.coupon_id
				// }
				// end

				// 选择门店:下单参数修改
				if (this.storeSkuCheck) {
					q.uniqueId = this.storeSkuCheck.unique
					q.productId = this.storeSkuCheck.product_id
				}

				postCartAdd(q)
					.then(function(res) {
						// 快捷下单
						// if(that.storeInfo.is_quickOrder==1&&that.attr.productSelect[that.attr.goodsTypeSelect].params.is_checked){
						//   // 重置属性弹窗
						//   that.isOpen=false
						//   app.globalData.quickFrom='myDetail'
						//   app.globalData.quickFirstData=res.data.quickParams
						//   app.globalData.quickFirstExtra=res.data.extraParams
						//   // console.log('================1================>', app.globalData.quickFirstData)
						//   // 快捷下单
						//   let lease_custom_start=moment(that.timeRange[0]).add(3,'days').format('YYYY-MM-DD')
						//   const outItemId = that.storeInfo.id; //商家侧商品 ID
						//   const outSkuId = that.attr.productSelect[that.attr.goodsTypeSelect].id; //商家侧商品 skuId
						//   const quantity = 1;  //数量
						//   const rentStartTime = moment(lease_custom_start).format('YYYY-MM-DD HH:mm:ss') || moment().format('YYYY-MM-DD HH:mm:ss'); //租赁开始时间
						//   const duration = that.quickDuration; //租期期数（单位：天）
						//   const source = 'merchantGoodsDetail';
						//   const bizIdentity = 'rent';
						//   my.navigateTo({
						//     url: `plugin://goodsDetailPlugin/rentOrder?outItemId=${outItemId}&outSkuId=${outSkuId}&quantity=${quantity}&rentStartTime=${rentStartTime}&duration=${duration}&source=${source}&bizIdentity=${bizIdentity}`
						//   });
						//   return
						// }

						that.isOpen = false;
						that.attr.cartAttr = false;

						if (res.data.exists_orderid) {
							let exists_orderid = res.data.exists_orderid
							uni.showModal({
								content: `该商品规格存在进行中的订单,请前往订单中心完成订单`,
								cancelText: '我知道了',
								confirmText: '查看订单',
								success: function(res) {
									if (res.confirm) {
										if (that.attr.goodsTypeSelect === 'lease') {
											uni.navigateTo({
												url: `/pages/goods/lease_order_details/index?order_id=${exists_orderid}`
											})
										} else {
											uni.navigateTo({
												url: `/pages/goods/order_details/index?order_id=${exists_orderid}`
											})
										}
									}
								}
							})
							return
						}

						// 选择门店：则替换商品id
						let product_id = that.storeSkuCheck ? that.storeSkuCheck.product_id : that.storeInfo.id
						// 确认订单
						if (news) {
							uni.navigateTo({
								url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cartId +
									'&delivery_type=' + delivery_type + '&addressId=' + that.addressId +
									'&store_id=' + that.store_id + '&store_name=' + that.store_name +
									'&product_id=' + product_id + '&is_store=' + (that.store_id ? 1 : 0) +
									'&shipping_time_limit=' + that.storeInfo.shipping_time_limit +
									'&isStoreSkuCheck=' + that.isStoreSkuCheck
							});
						} else {
							// 添加购物车
							that.$util.Tips({
								title: '添加购物车成功',
								success: () => {
									that.cartNum = res.data.cartNum;
									that.getCartCount(true);
								}
							});
						}
					})
					.catch(err => {
						that.isOpen = false;
						// return that.$util.Tips({
						// 	title: err
						// });
					});
			},
			/**
			 * 获取购物车数量
			 * @param boolean 是否展示购物车动画和重置属性
			 */
			getCartCount: function(isAnima) {
				let that = this;
				const isLogin = that.isLogin;
				let id = uni.getStorageSync('user_store_id') || 0;
				if (isLogin) {
					getCartCounts(0, id).then(res => {
						that.CartCount = res.data.count;
						this.$store.commit('indexData/setCartNum', that.CartCount + '')
						//加入购物车后重置属性
						if (isAnima) {
							that.animated = true;
							setTimeout(function() {
								that.animated = false;
							}, 500);
						}
					});
				}
			},
			/**
			 * 立即购买
			 */
			goBuy: function(e) {
				this.currentPage = false;
				// if (!this.isLogin) {
				// 	toLogin();
				// } else {
				// 	this.goCat(true,'buy');
				// }
				this.attr.goodsTypeSelect = 'mall'
				this.goCat(true, 'buy');
			},
			/**
			 * 立即购买
			 */
			goLease: function(e) {
				// 弹出订阅消息
				bookZfbMsg()
				this.currentPage = false;
				this.attr.goodsTypeSelect = 'lease'
				this.goCat(true, 'lease');
			},
			goLeaseZero: function(e) {
				if (this.is_super_user === 0) {
					uni.navigateTo({
						url: `/pages/users/zero_bag/detail`
					});
				} else {
					this.goLease()
				}
			},
			// 分享按钮
			listenerActionSheet: function() {
				this.currentPage = false
				// #ifdef H5
				if (this.$wechat.isWeixin() === true) {
					this.weixinStatus = true;
				}
				// #endif
				this.posters = true;
				this.goPoster();
			},
			// 分享关闭
			listenerActionClose: function() {
				this.posters = false;
			},
			//隐藏海报
			posterImageClose: function() {
				this.posterImageStatus = false;
				this.posters = false;
			},
			//替换安全域名
			setDomain: function(url) {
				url = url ? url.toString() : '';
				//本地调试打开,生产请注销
				if (url.indexOf('https://') > -1) return url;
				else return url.replace('http://', 'https://');
			},
			//获取海报产品图
			downloadFilestoreImage: function() {
				let that = this;
				uni.downloadFile({
					url: that.setDomain(that.storeInfo.image),
					success: function(res) {
						that.storeImage = res.tempFilePath;
						that.base64Show = 1;
					},
					fail: function() {
						return that.$util.Tips({
							title: ''
						});
						that.storeImage = '';
					}
				});
			},
			/**
			 * 获取产品分销二维码,小程序二维码
			 * @param function successFn 下载完成回调
			 *
			 */
			downloadFilePromotionCode: function(successFn) {
				let that = this;
				getProductCode(that.id).then(res => {
						uni.downloadFile({
							url: that.setDomain(res.data.code),
							success: function(res) {
								that.$set(that, 'isDown', false);
								if (typeof successFn == 'function') successFn && successFn(res
									.tempFilePath);
								else that.$set(that, 'PromotionCode', res.tempFilePath);
								// 下载海报
								// that.$nextTick(()=>{
								//   let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
								//   that.downPoster(arr2)
								// })
							},
							fail: function() {
								that.$set(that, 'isDown', false);
								that.$set(that, 'PromotionCode', '');
							}
						});
					})
					.catch(err => {
						that.$set(that, 'isDown', false);
						that.$set(that, 'PromotionCode', '');
					});
			},
			getImageBase64: function(type) {
				let that = this;
				imageBase64(that.storeImage, that.followCode)
					.then(res => {
						that.storeImage = res.data.image;
						if (type) {
							that.PromotionCode = res.data.code;
						}
						that.base64Show = 1;
					})
					.catch(() => {});
			},
			// 小程序关闭分享弹窗；
			// goFriend: function() {
			// 	this.posters = false;
			// },

			// 下载海报
			downPoster(arr2) {
				let that = this;
				that.$nextTick(function() {
					setTimeout(() => {
						// 商城价格
						let price = that.storeInfo.price
						let ot_price = that.storeInfo.ot_price
						// 租赁显示天数价格
						if (that.attr.goodsType == 'lease' || that.attr.goodsType == 'All') {
							price = that.storeInfo.day_price + '/天'
							ot_price = undefined
						}
						that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName,
							arr2, that.storeInfo.store_name, price, ot_price, that.posterTitle,
							function(tempFilePath) {
								that.$set(that, 'posterImage', tempFilePath);
								that.$set(that, 'posterImageStatus', true);
								that.$set(that, 'canvasStatus', false);
								that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
							});
					}, 1000)
				})
			},
			/**
			 * 生成海报
			 */
			goPoster: function() {
				let that = this;
				that.$set(that, 'canvasStatus', true);
				let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
				// #ifdef MP
				if (that.PromotionCode == '' && !that.isDown) {
					return that.$util.Tips({
						title: '小程序二维码需要发布正式版后才能获取到'
					}, function() {
						that.posters = false;
					});
				}
				if (that.isDown)
					return that.$util.Tips({
						title: '正在下载海报,请稍后再试！'
					}, function() {
						that.posters = false;
					});
				// #endif
				uni.getImageInfo({
					src: that.PromotionCode,
					fail: function(res) {
						// #ifdef H5 || APP-PLUS
						return that.$util.Tips({
							title: res.errMsg
						});
						// #endif
						// #ifdef MP
						return that.$util.Tips({
							title: '小程序二维码需要发布正式版后才能获取到'
						});
						// #endif
					},
					success() {
						if (arr2[2] == '') {
							//海报二维码不存在则从新下载
							that.downloadFilePromotionCode(function(msgPromotionCode) {
								arr2[2] = msgPromotionCode;
								if (arr2[2] == '')
									return that.$util.Tips({
										title: '海报二维码生成失败！'
									});
								// 下载海报
								that.downPoster(arr2)
							});
						} else {
							// 下载海报
							that.downPoster(arr2)
						}
					}
				});
			},

			/*
			 * 保存到手机相册
			 */
			// #ifdef MP
			copyCommand: function() {
				if (wx.navigateToMiniProgram) {
					wx.navigateToMiniProgram({
						appId: 'wxb036cafe2994d7d0',
						path: '/publish/ugc-publish/ugc-publish',
						extraData: {
							productInfo: {
								title: this.storeInfo.store_name,
								path: '/pages/goods_details/index?id=' + this.storeInfo.id,
								thumbUrl: this.storeInfo.image
							}
						}
					});
				}
			},
			savePosterPath: function() {
				let that = this;
				uni.getSetting({
					success(res) {
						if (!res.authSetting['scope.writePhotosAlbum']) {
							// #ifdef MP-ALIPAY
							uni.saveImageToPhotosAlbum({
								filePath: that.posterImage,
								success: function(res) {
									that.posterImageClose();
									that.$util.Tips({
										title: '保存成功',
										icon: 'success'
									});
								},
								fail: function(res) {
									that.$util.Tips({
										title: '保存失败'
									});
								}
							});
							return
							// #endif
							uni.authorize({
								scope: 'scope.writePhotosAlbum',
								success() {
									uni.saveImageToPhotosAlbum({
										filePath: that.posterImage,
										success: function(res) {
											that.posterImageClose();
											that.$util.Tips({
												title: '保存成功',
												icon: 'success'
											});
										},
										fail: function(res) {
											that.$util.Tips({
												title: '保存失败'
											});
										}
									});
								}
							});
						} else {
							uni.saveImageToPhotosAlbum({
								filePath: that.posterImage,
								success: function(res) {
									that.posterImageClose();
									that.$util.Tips({
										title: '保存成功',
										icon: 'success'
									});
								},
								fail: function(res) {
									that.$util.Tips({
										title: '保存失败'
									});
								}
							});
						}
					}
				});
			},
			// #endif
			//#ifdef APP-PLUS
			savePosterPath() {
				let that = this
				uni.saveImageToPhotosAlbum({
					filePath: that.posterImage,
					success: function(res) {
						that.posterImageClose();
						that.$util.Tips({
							title: '保存成功',
							icon: 'success'
						});
					},
					fail: function(res) {
						that.$util.Tips({
							title: '保存失败'
						});
					}
				});
			},
			// #endif


			//#ifdef H5
			ShareInfo() {
				let data = this.storeInfo;
				let href = location.href;
				if (this.$wechat.isWeixin()) {
					getUserInfo().then(res => {
						href = href.indexOf('?') === -1 ? href + '?spid=' + res.data.uid : href + '&spid=' + res.data.uid;
						let configAppMessage = {
							desc: data.store_info,
							title: data.store_name,
							link: href,
							imgUrl: data.image
						};
						this.$wechat
							.wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData',
								'onMenuShareAppMessage',
								'onMenuShareTimeline'
							], configAppMessage)
							.then(res => {})
							.catch(err => {});
					});
				}
			},
			//#endif
			goDiscounts() {
				uni.navigateTo({
					url: '/pages/goods_details/discountsGoodsList?id=' + this.id
				})
			},
			// 去其他页面
			goPage(type, url) {
				console.log(type, url)
				if (type == 1) {
					uni.navigateTo({
						url
					})
				} else if (type == 2) {
					uni.reLaunch({
						url
					})
				} else if (type == 3) {
					uni.navigateBack();
				}

			},
			// 优惠弹窗
			ChangCouponsUseState(index) {
				console.log(index, '111');
				let that = this;
				that.coupon.list[index].is_use = true;
				that.$set(that.coupon, 'list', that.coupon.list);
				that.$set(that.coupon, 'coupon', false);
			},
			/**
			 * 领取完毕移除当前页面领取过的优惠券展示
			 */
			ChangCoupons: function(e) {

			},
			// 优惠弹窗
			ruleToggle(index) {
				this.coupon.list[index].ruleshow = !this.coupon.list[index].ruleshow;
			},
			// 客服
			goGoodCall() {
				this.$refs.chatModal.open()
				return;

				// 未登录：跳转离线客服
				if (!this.isLogin) {
					uni.navigateTo({
						url: '/pages/extension/customer_list/feedback'
					});
					return
				}
				let userInfo = {}
				if (typeof this.userInfo === 'string') {
					userInfo = JSON.parse(this.userInfo)
				} else {
					userInfo = this.userInfo
				}
				let url = `/pages/extension/customer_list/chat?productId=${this.id}`
				let obj = {
					store_name: this.storeInfo.store_name,
					path: `/pages/goods_details/index?id=${this.storeInfo.id}`,
					image: this.storeInfo.image
				}
				this.$util.getCustomer(userInfo, url, obj, 1)
			},
			colorData() {
				let color = [{
						themeColor: '#1DB0FC',
						fontColor: '#FD502F'
					},
					{
						themeColor: '#42CA4D',
						fontColor: '#FF7600'
					},
					{
						themeColor: '#e93323',
						fontColor: '#e93323'
					},
					{
						themeColor: '#FF448F',
						fontColor: '#FF448F'
					},
					{
						themeColor: '#FE5C2D',
						fontColor: '#FE5C2D'
					},
					{
						themeColor: '#E0A558',
						fontColor: '#DA8C18',
					}
				];
				setTimeout(() => {
					switch (this.colorNum) {
						case 1:
							this.themeColor = color[0].themeColor;
							this.fontColor = color[0].fontColor;
							break;
						case 2:
							this.themeColor = color[1].themeColor;
							this.fontColor = color[1].fontColor;
							break;
						case 3:
							this.themeColor = color[2].themeColor;
							this.fontColor = color[2].fontColor;
							break;
						case 4:
							this.themeColor = color[3].themeColor;
							this.fontColor = color[3].fontColor;
							break;
						case 5:
							this.themeColor = color[4].themeColor;
							this.fontColor = color[4].fontColor;
							break;
						case 6:
							this.themeColor = color[5].themeColor;
							this.fontColor = color[5].fontColor;
							break;
						default:
							this.themeColor = color[2].themeColor;
							this.fontColor = color[2].fontColor;
							break
					}
				}, 1)
			},
			// 租赁说明
			getLeaseDesc() {
				getLeaseDesc(this.storeInfo.desc_id).then(res => {
					if (res.status == 200) {
						this.leaseDesc = res.data.content;
					}
				})
			},
		},
		onPageScroll(object) {
			this.$set(this, 'currentPage', false);
			if (object.scrollTop > 340) {
				this.pageScrollStatus = true;
			} else if (object.scrollTop < 340) {
				this.pageScrollStatus = false;
			}
			// 触发图片懒加载
			uni.$emit('scroll');
		},

	};
</script>

<style lang="scss"
	scoped>
	/deep/ uni-video {
		width: 100% !important;
	}

	/deep/ video {
		width: 100% !important;
	}

	.wrap {}

	.activess {
		font-weight: 500;
		color: var(--view-theme);
		position: relative;

		&::after {
			position: absolute;
			content: '';
			width: 36rpx;
			//height: 30rpx;
			border: 2rpx solid var(--view-theme);
			border-radius: 10rpx;
			//border-left: 2px solid transparent !important;
			//border-top: 2px solid transparent !important;
			//border-right: 2px solid transparent !important;
			//border-radius: 50%;
			left: 50%;
			bottom: -12rpx;
			margin-left: -24rpx;
		}
	}

	.activesss {
		color: #fff;
		padding: 10upx 30upx;
		background-color: var(--view-gradient);
	}

	.z-99 {
		z-index: 99;
	}

	.menu_box {
		width: 154rpx;
		height: 58rpx;
		border-radius: 29rpx;
		z-index: 999;
	}

	.menu_line {
		width: 1px;
		height: 30rpx;
		background: #B3B3B3;
	}

	.opac {
		background-color: rgba(255, 255, 255, 0.13);
		border: 1rpx solid rgba(0, 0, 0, 0.1);
		justify-content: space-evenly;
	}



	.atmosphere-card {
		//margin-top: -34rpx;
		//margin-bottom: -34rpx;
		margin-top: -54rpx;
		background-size: cover;
		background-repeat: no-repeat;

		//padding-top: 52rpx
		.atmosphere-card-price {
			align-items: flex-end;
			padding-bottom: 36rpx;
		}
	}

	.bg--w111-484643 {
		background: linear-gradient(90deg, #484643 0%, #1F1B17 100%);
	}

	.text--w111-FDDAA4 {
		color: #FDDAA4;
	}

	.svip-badge {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		border-radius: 8rpx;
		background-color: #F7E9CD;
		margin-left: 8rpx;
		position: relative;
		bottom: 4rpx;
	}

	.svip_rd {
		border-radius: 14rpx 0 8rpx 14rpx;
	}

	.break_word {
		overflow-wrap: break-word;
		white-space: normal;
	}

	.white-nowrap {
		white-space: nowrap;
	}

	.w-530 {
		width: 530rpx;
	}

	.w-524 {
		width: 524rpx;
	}

	.w-76 {
		width: 76rpx;
	}

	.active_pic {
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #fff;
		border-radius: 16rpx;
		border: 1px solid #333;
		padding: 4rpx;

		image {
			width: 68rpx;
			height: 68rpx;
			border-radius: 12rpx;
		}
	}

	.scroll_pic {
		height: 80rpx;

		image {
			width: 80rpx;
			height: 80rpx;
			border-radius: 16rpx;
		}
	}

	.icon-ic_star1 {
		color: var(--view-theme);
	}

	.join_cart {
		background-color: var(--view-bntColor);
	}

	.text-primary-con {
		color: var(--view-theme);
	}

	.bg-primary-light {
		background: var(--view-minorColorT);
	}

	.recommend_pro~.recommend_pro {
		margin-left: 38rpx;
	}

	.page_footer {
		backdrop-filter: blur(10px);
		border-top: 1px solid #f5f5f5;
	}

	.num-badge {
		color: #fff;
		position: absolute;
		padding: 2rpx 10rpx 3rpx;
		border-radius: 200rpx;
		top: 0;
		right: 10rpx;
	}

	.bg-transparent {
		background: transparent;
	}

	.generate-posters {
		width: 100%;
		background-color: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 388;
		transform: translate3d(0, 100%, 0);
		transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
		border-top: 1rpx solid #eee;
		border-radius: 40rpx 40rpx 0 0;

		.generateCon {
			height: 220rpx;
		}

		.generateClose {
			width: 654rpx;
			height: 72rpx;
			background: #F5F5F5;
			border-radius: 36rpx;
			font-weight: 500;
			margin: 0 auto 40rpx;
		}

		.item {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
			height: 130rpx;

			.pictrue {
				width: 86rpx;
				height: 86rpx;
				border-radius: 50%;
				margin: 0 auto 12rpx auto;

				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}
		}
	}

	.generate-posters.on {
		transform: translate3d(0, 0, 0);
	}

	.generate-posters .item {
		flex: 1;
		text-align: center;
	}

	.canvas {
		z-index: 300;
		width: 750px;
		height: 1300px;
		position: relative;
		bottom: -10000rpx;
	}

	.poster-mask {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.8);
		z-index: 30;
		backdrop-filter: blur(5px);
	}

	.poster-loading {
		position: relative;
		width: 100%;
		z-index: 31;
	}

	.fixed-center {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
	}

	.poster-pop {
		width: 460rpx;
		height: 800rpx;
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		z-index: 399;
		top: 50%;
		margin-top: -559rpx;
	}

	.poster-pop image {
		width: 100%;
		height: 100%;
		display: block;
		border-radius: 18rpx;
	}

	.poster-pop .close {
		width: 46rpx;
		height: 75rpx;
		position: fixed;
		right: 0;
		top: -73rpx;
		display: block;
	}

	.poster-pop .save-poster {
		background-color: #df2d0a;
		color: #fff;
		text-align: center;
		height: 76rpx;
		line-height: 76rpx;
		width: 100%;
	}

	.poster-pop .keep {
		color: #fff;
		text-align: center;
		margin-top: 10rpx;
	}

	.conter {
		display: block;
		overflow: auto;
		margin-bottom: 40upx;
		padding-bottom: 200rpx;
	}

	.conter img {
		display: block;
	}

	.common-price {
		flex: 1;
		display: flex;
		justify-content: space-between;
		align-items: baseline;

	}

	.bottom-box {
		display: flex;
		justify-content: space-between;
		font-weight: bold;

		>view {
			flex: 1;
		}
	}

	.params-box {
		padding: 20rpx;

		.item {
			margin-bottom: 4rpx;

			.l {
				flex-basis: 150rpx;
				/* 初始宽度 */
				flex-shrink: 0;
				/* 防止缩小 */
				background: #f7f7f7;
				margin-right: 4rpx;
				color: #9b9b9b;
			}

			.r {
				flex-grow: 1;
				background: #f7f7f7;
			}
		}
	}
</style>

<style lang="scss"
	scoped>
	.zhima-box {
		border-radius: 10px;
		background: #e7f1ff;

		.l {
			background: #1677ff;
			color: #fff;
			padding: 8rpx 10rpx;
			border-radius: 10rpx;
		}
	}

	//.rd-12rpx,.rd-24rpx,.rd-16rpx,.rd-36px,.rd-28rpx,.rd-40rpx,.rd-30rpx{
	//  border-radius: 4rpx !important;
	//}
	.live-picture {
		.live-tit {
			padding: 50rpx 0 20rpx;

			.l {
				text-align: center;
				font-weight: bold;
			}

			.r {
				text-align: right;
				margin-top: 20rpx;
				color: #999;
			}
		}

		.live-con {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

			.live-item {
				width: 50%;
				height: 360rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		.live-tip {
			line-height: 1.5;
			padding: 20rpx;
			margin: 30rpx 12rpx;
			color: #999;
			border-radius: 4rpx;
		}
	}

	.zhima-box-new {
		color: #666;

		.line {
			width: 1rpx;
			height: 18rpx;
			background: #ccc;
			margin: 0 12rpx;
		}
	}

	.top-box {
		display: flex;
		align-items: center;
		color: #666;

		.top-item {
			display: flex;
			align-items: center;
			border: 1rpx solid #f5f5f5;
			border-radius: 4rpx;
			height: 36rpx;
			padding: 0 8rpx;
		}
	}

	.wrap {
		background: #fff;
	}

	.newold-box {
		padding: 20rpx;

		.line {
			border-bottom: 2rpx solid #eee;
			margin: 20rpx 0;
		}

		.item-one {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx 0;

			.l {
				display: flex;
				align-items: center;
				line-height: 1;

				.l-1 {
					display: flex;
					align-items: flex-start;
					line-height: 1 !important;
				}

				.line {
					height: 36rpx;
					width: 2rpx;
					background: #ccc;
					margin: 0 20rpx;
				}
			}

			.r {
				color: #999;
			}
		}

		.item-two {
			display: flex;
			line-height: 1;

			.l {
				margin-right: 20rpx;
			}

			.c {
				flex: 1;
				display: flex;
				overflow-x: auto;

				.c-item {
					flex: 0 0 80rpx;
					max-width: 150rpx;
					margin-right: 30rpx;

					.tit {
						width: 100%;
						margin-bottom: 10rpx;
					}

					.value {
						width: 100%;
						color: #999;
					}
				}
			}

			.r {
				display: flex;
				align-items: center;
			}
		}
	}

	.relate-goods {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		padding: 30rpx 20rpx;
		background: #fff;
		overflow-x: auto;

		.line-text {
			flex: 0 0 auto;
			margin-right: 20rpx;
		}

		.item {
			flex: 0 0 auto;
			display: flex;
			border: 1rpx solid #f7f7f7;
			background: #f7f7f7;
			padding: 20rpx;
			border-radius: 20rpx;
			margin-right: 20rpx;

			.l {
				width: 60rpx;
				height: 60rpx;
			}

			.r {
				margin-left: 20rpx;

				.title {
					color: #666;
					margin-bottom: 6rpx;
					max-width: 160rpx;
				}

				.price {
					font-weight: bold;
				}
			}
		}

		.item-active {
			border-color: var(--view-theme);
		}

		.item-store {
			position: relative;
			padding-right: 50rpx;

			.store-tip {
				position: absolute;
				top: 0;
				right: 0;
				border-top-right-radius: 20rpx;
				border-bottom-left-radius: 20rpx;
				line-height: 1;
				font-size: 18rpx;
				padding: 6rpx 10rpx;
				background: #ddd;
				color: #666;
			}
		}
	}
</style>